Skip to content

Commit 85f8a5f

Browse files
committed
fix get_image_metadata
1 parent c95a97b commit 85f8a5f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

superannotate/db/images.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ def get_image_metadata(project, image_names):
160160
)
161161

162162
metadata = response.json()
163+
if len(metadata) == 0:
164+
raise SABaseException(
165+
0,
166+
f"None of the images in {image_names} exist in the provided project"
167+
)
163168
for item in metadata:
164169
item['annotation_status'] = common.annotation_status_int_to_str(
165170
item['annotation_status']

superannotate/db/project_images.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def copy_image(
181181
else:
182182
new_name = new_name[:m.start() +
183183
2] + str(num + 1) + ")" + extension
184+
184185
upload_image_to_project(destination_project, img_b, new_name)
185186
if include_annotations:
186187
annotations = get_image_annotations(source_project, image_name)

tests/test_ml_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_run_segmentation():
114114
assert (len(succeded_imgs) + len(failed_imgs)) == 4
115115

116116
succeded_imgs, failed_imgs = sa.run_segmentation(
117-
ROJECT_NAME_PIXEL, image_names_pixel[:4] + ["NA.jpg"], Pmodel_auto
117+
PROJECT_NAME_PIXEL, image_names_pixel[:4] + ["NA.jpg"], Pmodel_auto
118118
)
119119

120120
assert (len(succeded_imgs) + len(failed_imgs)) == 4

0 commit comments

Comments
 (0)