Skip to content

Commit

Permalink
add warning if image not found
Browse files Browse the repository at this point in the history
  • Loading branch information
vorozhkog committed Nov 5, 2024
1 parent b773522 commit 588a4bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion project-dataset/src/ui/inference_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,13 @@ def get_inference_progress(inference_request_uuid):
},
)
image_info = api.image.get_info_by_id(id=image_id)
if image_info is None:
sly.logger.warn(
f"Image (id: {image_id}) is either archived, doesn't exist or you don't have enough permissions to access it"
)

sly.logger.warn(
f"Couldn't process annotation prediction for image: {image_info.name if image_info else "Image not found"} (ID: {image_id}). Image remain unchanged. Error: {e}"
f"Couldn't process annotation prediction for image: {image_info.name or "Image not found"} (ID: {image_id}). Image remain unchanged. Error: {e}"
)
pred_json = sly.Annotation(img_size=(image_info.height, image_info.width)).to_json()
ann_pred_json.append(pred_json)
Expand Down

0 comments on commit 588a4bd

Please sign in to comment.