TensorFlow Object Detection API print objects found on image to console

前端 未结 6 1761
星月不相逢
星月不相逢 2021-02-01 06:31

I\'m trying to return list of objects that have been found at image with TF Object Detection API.

To do that I\'m using print([category_index.get(i) for

6条回答
  •  情歌与酒
    2021-02-01 07:06

    As far as I can see you have 300 detections. visualize_boxes_and_labels_on_image_array shows very few of them because min_score_thresh=.5 (this is the default value) is too high for the most of them.

    If you want to add such filtering to the output you can write:

    min_score_thresh = 0.5
    print([category_index.get(i) for i in classes[0] if scores[0, i] > min_score_thresh)
    

    You can change min_score_thresh to choose threshold value you need. It may be useful to print the score values with the category names.

提交回复
热议问题