Skip to content

Commit

Permalink
Improve logging for unsupported geometries by formatting warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenAnpu committed Dec 20, 2024
1 parent 731fb7b commit d613f39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ def process(self, context: sly.app.Export.Context):
ann = f.check_sly_annotations(ann_info, img_info, project_meta, unsupported_anns)
anns.append(ann)
if unsupported_anns:
formatted_message = ", ".join(
[
f"[ID: {img_id}, Name: {info['name']}, Count: {info['count']}]"
for img_id, info in unsupported_anns.items()
]
)
sly.logger.warning(
f"Objects with unsupported geometries for images were found: {json.dumps(unsupported_anns, indent=2)}"
f"Objects with unsupported geometries for images were found: {formatted_message}"
)
coco_ann, label_id = f.create_coco_annotation(
coco_ann,
Expand Down

0 comments on commit d613f39

Please sign in to comment.