Output score , class and id Extraction using TensorFlow object detection

前端 未结 3 1132
执念已碎
执念已碎 2021-01-25 21:33

How can I extract the output scores for objects , object class ,object id detected in images , generated by the Tensorflow Model for Object Detection ?

I want to store

3条回答
  •  一整个雨季
    2021-01-25 22:23

    Get class name, your label map should be able to help here.

    from object_detection.utils import label_map_util
    
    label_map_path = os.path.join(annotations_dir, 'label_map.pbtxt')
    label_map_dict = label_map_util.get_label_map_dict(label_map_path)
    label_map_dict_number_to_name = {v: k for k, v in label_map_dict.iteritems()}
    class_number = output_dict['detection_classes'][index]
    class_name = label_map_dict_number_to_name[class_number]
    

    Please paste your code, so we can figure out why only one box is in y

提交回复
热议问题