Skip to content

Commit 7214755

Browse files
committed
Fix annotation adding test
1 parent 790565d commit 7214755

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

superannotate/db/annotation_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def download_annotation_classes_json(project, folder):
296296

297297

298298
def fill_class_and_attribute_names(annotations_json, annotation_classes_dict):
299-
for r in annotations_json:
299+
for r in annotations_json["instances"]:
300300
if "classId" in r and r["classId"] in annotation_classes_dict:
301301
r["className"] = annotation_classes_dict[r["classId"]]["name"]
302302
if "attributes" in r:

tests/test_annotation_adding.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_add_bbox_noinit(tmpdir):
128128
annotations_new = sa.get_image_annotations(project,
129129
image_name)["annotation_json"]
130130

131-
assert len(annotations_new) == 2
131+
assert len(annotations_new["instances"]) == 2
132132
export = sa.prepare_export(project, include_fuse=True)
133133
sa.download_export(project, export, tmpdir)
134134
assert len(list(Path(tmpdir).rglob("*.*"))) == 4
@@ -167,4 +167,7 @@ def test_add_bbox_json(tmpdir):
167167
)
168168
annotations_new = json.load(open(dest))
169169

170-
assert len(annotations_new) == len(annotations) + 8
170+
assert len(annotations_new["instances"]
171+
) == len(annotations["instances"]) + 7
172+
assert len(annotations_new["comments"]
173+
) == len(annotations["comments"]) + 1

0 commit comments

Comments
 (0)