Skip to content

Commit

Permalink
add .venv to .gitignore;
Browse files Browse the repository at this point in the history
add exception handler for def sly.imgaug_utils.apply;
  • Loading branch information
GoldenAnpu committed Oct 16, 2023
1 parent 2fe1231 commit 38a6556
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
secret_debug.env
.idea
venv
.venv
supervisely_lib
images/*
src/conf.py
Expand Down
8 changes: 7 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ def preview_augs(api: sly.Api, task_id, augs, infos, py_code=None):
ann_json = api.annotation.download(img_info.id).annotation
ann = sly.Annotation.from_json(ann_json, meta)

res_meta, res_img, res_ann = sly.imgaug_utils.apply(augs, meta, img, ann)
try:
res_meta, res_img, res_ann = sly.imgaug_utils.apply(augs, meta, img, ann)
except ValueError as e:
if str(e) == 'cannot convert float NaN to integer':
raise e('Please check the values of the augmentation parameters')
else:
raise e
file_info = save_preview_image(api, task_id, res_img)

# rename polygonal labels in existing annotation to keep them in gallery in before section
Expand Down

0 comments on commit 38a6556

Please sign in to comment.