Skip to content

Commit 76482ac

Browse files
Merge pull request #196 from fastlabel/feature/prioritize-categories-name-in-coco-format
Adjusted to prioritize 'name' from COCO format as FastLabel value
2 parents 149af98 + 35f1006 commit 76482ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastlabel/converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ def execute_coco_to_fastlabel(coco: dict, annotation_type: str) -> dict:
844844
coco_categories = {}
845845
coco_categories_keypoints = {}
846846
for c in coco["categories"]:
847-
coco_categories[c["id"]] = c["supercategory"]
848-
coco_categories_keypoints[c["id"]] = c["keypoints"]
847+
coco_categories[c["id"]] = c["name"] if c.get("name") else c["supercategory"]
848+
coco_categories_keypoints[c["id"]] = c["keypoints"] if c.get("keypoints") else []
849849

850850
coco_annotations = coco["annotations"]
851851

0 commit comments

Comments
 (0)