Skip to content

Commit

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

else:
img_name = image_info.name
sly.logger.warn(
f"Couldn't process annotation prediction for image: {image_info.name or "Image not found"} (ID: {image_id}). Image remain unchanged. Error: {e}"
f"Couldn't process annotation prediction for image: {img_name} (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 999cab7

Please sign in to comment.