Reputation: 325
I'm running detection with the Tensorflow Object Detection API with the default model and I'd just like to print the detection scores to the console.
For example object_detection_tutorial.ipynb
has a function called visualize_boxes_and_labels_on_image_array
that draws bounding boxes on the image. This function has a parameter min_score_thresh=.5
and if you change it it draws bounding boxes for everything above that threshold.
i'm not visualizing the images though, just want to print out the score for anything > 0.2
but I can't find a way to specify this?
Currently it's only printing to the console detections with scores above .5
which i guess is the default?
Upvotes: 1
Views: 5467
Reputation: 21
visualize_boxes_and_labels_on_image_array
method has a parameter min_score_thresh
. you can pass your threshold values as visualize_boxes_and_labels_on_image_array(min_score_thresh=.2)
.
Its default values is set to 0.5.
Upvotes: 2
Reputation: 268
Go to utils/visualization_utils.py and find visualize_boxes_and_labels_on_image_array() and change the default value of min_score_thresh to whatever you want. By default, the value is 0.5.
Upvotes: 0
Reputation: 452
Looks like you want to query based on scores, following is code you can use on output_dict
for index, value in enumerate(output_dict['detection_classes'][0]):
if(scores[index] > **0.2**):
if((category_index.get(value)).get('name').encode('utf8') == b'person'):
print("Car exists at Index,value : ",index, value)
personExists = True[![enter image description here][1]][1]
print("person Exists: {} ",personExists)
Code here if formatting above is not clear:
Upvotes: 0