Skip to content

Commit

Permalink
feat: add validation check for group_id in shape data
Browse files Browse the repository at this point in the history
  • Loading branch information
CVHub520 committed Nov 11, 2024
1 parent 398cb6b commit 9399676
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions anylabeling/views/labeling/label_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,13 @@ def custom_to_yolo( # noqa: C901
elif mode == "pose":
if shape_type not in ["rectangle", "point"]:
continue
if shape["group_id"] is None:
logger.error(
f"group_id is None for {shape} in {input_file}."
)
raise ValueError(
f"group_id is None for {shape} in {input_file}."
)
label = shape["label"]
points = shape["points"]
group_id = int(shape["group_id"])
Expand Down

0 comments on commit 9399676

Please sign in to comment.