🛠️ fix coco segmentation data for polygon should be [polygon,] not polygon

Format coco output data as per standard
This commit is contained in:
Piotr Skalski 2023-07-24 14:07:10 +02:00 committed by GitHub
commit 8662671e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)