Skip to content

Commit 1b93158

Browse files
committed
Delete all images from folder
1 parent a113e5c commit 1b93158

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

superannotate/db/project_images.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,16 @@ def delete_images(project, image_names):
235235
:param folder_names: to be deleted folders' names
236236
:type folder_names: str or list of strs
237237
"""
238-
if not isinstance(image_names, list):
239-
raise SABaseException(0, "image_names should be a list of strs")
240-
images = get_image_metadata(
241-
project, image_names, return_dict_on_single_output=False
242-
)
238+
if image_names is None:
239+
images = search_images(project, return_metadata=True)
240+
else:
241+
if not isinstance(image_names, list):
242+
raise SABaseException(
243+
0, "image_names should be a list of strs or None"
244+
)
245+
images = get_image_metadata(
246+
project, image_names, return_dict_on_single_output=False
247+
)
243248
project, _ = get_project_and_folder_metadata(project)
244249

245250
params = {"team_id": project["team_id"], "project_id": project["id"]}

0 commit comments

Comments
 (0)