Skip to content

Commit 6e03bac

Browse files
committed
Fix annotation download with folders
1 parent 1a7a06a commit 6e03bac

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

superannotate/db/images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,15 +681,15 @@ def get_image_annotations(project, image_name, project_folder=None):
681681
:rtype: dict
682682
"""
683683
return _get_image_pre_or_annotations(
684-
project, image_name, "", project_folder
684+
project, image_name, "", None, project_folder
685685
)
686686

687687

688688
def _get_image_pre_or_annotations(
689689
project, image_name, pre, project_type=None, project_folder=None
690690
):
691-
image = get_image_metadata(project, image_name)
692-
team_id, project_id, image_id, folder_id = image["team_id"], image[
691+
image = get_image_metadata(project, image_name, True, project_folder)
692+
team_id, project_id, image_id, project_folder_id = image["team_id"], image[
693693
"project_id"], image["id"], image['folder_id']
694694
if project_type is None:
695695
if not isinstance(project, dict):
@@ -698,7 +698,7 @@ def _get_image_pre_or_annotations(
698698
params = {
699699
'team_id': team_id,
700700
'project_id': project_id,
701-
'folder_id': folder_id
701+
'folder_id': project_folder_id
702702
}
703703
response = _api.send_request(
704704
req_type='GET',

tests/test_folders.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def test_folder_annotations(tmpdir):
132132
sa.upload_annotations_from_folder_to_project(
133133
project, FROM_FOLDER, project_folder=folders[0]
134134
)
135-
print(folders[0])
136135
annot = sa.get_image_annotations(project, "example_image_1.jpg")
137136
assert len(annot["annotation_json"]["instances"]) == 0
138137

0 commit comments

Comments
 (0)