Skip to content

Commit

Permalink
Fix bug: list index out of range for exporting dota annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
CVHub520 committed Apr 22, 2024
1 parent cd422f5 commit 755c578
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion anylabeling/views/labeling/label_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,11 @@ def custom_to_dota(self, input_file, output_file):
data = json.load(f)
with open(output_file, "w", encoding="utf-8") as f:
for shape in data["shapes"]:
label = shape["label"]
points = shape["points"]
shape_type = shape["shape_type"]
if shape_type != "rotation" or len(points) != 4:
continue
label = shape["label"]
difficult = shape.get("difficult", False)
x0 = points[0][0]
y0 = points[0][1]
Expand Down

0 comments on commit 755c578

Please sign in to comment.