From d613f39e14cfea913ee346b18f6899f40ee4d8a7 Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Fri, 20 Dec 2024 21:30:23 +0100 Subject: [PATCH] Improve logging for unsupported geometries by formatting warning message --- src/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 1a381f7..925466f 100644 --- a/src/main.py +++ b/src/main.py @@ -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,