From 34bd1ceb50357fde8e30883032fbb602cbd298db Mon Sep 17 00:00:00 2001 From: Reza Karbasi Date: Wed, 4 Dec 2024 13:50:45 +0330 Subject: [PATCH] Fix: Handle polygons with zero points in export process (Issue #365) --- src/label_studio_sdk/converter/converter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/label_studio_sdk/converter/converter.py b/src/label_studio_sdk/converter/converter.py index eb46c269e..52750c654 100644 --- a/src/label_studio_sdk/converter/converter.py +++ b/src/label_studio_sdk/converter/converter.py @@ -920,6 +920,8 @@ def convert_to_yolo( annotations.append([category_id, x, y, w, h]) elif "polygonlabels" in label or "polygon" in label: + if not ('points' in label): + continue points_abs = [(x / 100, y / 100) for x, y in label["points"]] annotations.append( [category_id]