accomodate for no polygon indices
This commit is contained in:
1 parent
bc0a38500d
commit
6587f39b0f
1 file changed
+1
-1
@@ -124,7 +124,7 @@ def detections_to_coco_annotations(
|
||||
"category_id": int(class_id),
|
||||
"bbox": [xyxy[0], xyxy[1], box_width, box_height],
|
||||
"area": box_width * box_height,
|
||||
"segmentation": [polygon],
|
||||
"segmentation": [polygon] if polygon else [],
|
||||
"iscrowd": 0,
|
||||
}
|
||||
coco_annotations.append(coco_annotation)
|
||||
|
||||
Reference in new issue
Block a user