rafaelpadilla / review_object_detection_metrics

Object Detection Metrics. 14 object detection metrics: mean Average Precision (mAP), Average Recall (AR), Spatio-Temporal Tube Average Precision (STT-AP). This project supports different bounding box formats as in COCO, PASCAL, Imagenet, etc.
Other
1.09k stars 215 forks source link

bug: can not parse lableme special type , "shape_type": "polygon" #79

Closed franztao closed 2 years ago

franztao commented 3 years ago

ValueError Traceback (most recent call last)

in 1 src=r"C:\Users\franztao\Desktop\0819_project\data\tsr_anno" ----> 2 bbs_ground_true=get_ground_true(src) 3 # dst=r"C:\Users\franztao\Desktop\0819_project\data\tsr_anno_single" in get_ground_true(src) 6 continue 7 print(root,file) ----> 8 labelme_bbs: BoundingBox = converter.labelme2bb(os.path.join(root, file)) 9 bbs = bbs + labelme_bbs 10 return bbs C:\ProgramData\Anaconda3\lib\site-packages\src-0.1.0-py3.8.egg\src\utils\converter.py in labelme2bb(annotations_path) 216 for obj in json_object['shapes']: 217 obj_label = obj['label'] --> 218 ((x1, y1), (x2, y2)) = obj['points'] 219 # If there is no bounding box annotations, bb coordinates could have been set to None 220 if x1 is None and y1 is None and x2 is None and y2 is None: ValueError: too many values to unpack (expected 2) ![image](https://user-images.githubusercontent.com/6941820/136888526-686f8c9c-a3d9-4748-a131-a1b34c05ae31.png)
rafaelpadilla commented 3 years ago

Hi @hengfanz,

This is not a bug.

The annotations must be in bounding box formats ("shape_type":"rectangle"), not polygons.

Please, check here examples of label me files.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.