This script generates a confusion matrix using the detections record file generated by the /object_detection/inference/infer_detections.py
script.
For a full description of the format of the matrix, and how it is computed, take a look at the Confusion Matrix in Object Detection with TensorFlow article.
To run this script you need a couple of things:
-
The label map used by your model — This is the proto-buff file that you created in order to train your model.
-
A detection record file — This is the file generated by using the
/object_detection/inference/infer_detections.py
. This script runs a TFRecord file through your model and saves the results in a detection record file.
Here is an example of running the script:
python confusion_matrix.py --detections_record=testing_detections.record --label_map=label_map.pbtxt
The script will print the confusion matrix along with precision and recall information to the standard output.