-
Notifications
You must be signed in to change notification settings - Fork 5
Fix/empty layers #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/empty layers #215
Conversation
| try { | ||
| annotation = ULabelAnnotation.from_json(ulabel.subtasks[stkey]["annotations"]["access"][ulabel.subtasks[stkey]["annotations"]["ordering"][i]]); | ||
| } catch (e) { | ||
| console.error("Error validating annotation during submit.", e); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we ensure that the annotations being delivered are still valid ULabelAnnotation objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good, although that line certainly make me want to write some annotation getters...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Covered in #198)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never ran into any errors with the loader but just to be safe i figured id add it
joshua-dean
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix/empty layers
Description
submit_buttonhook payload.Testing
A user of ULabel found that empty
[]layers were occasionally present in the polygon annotations provided by the ULabel submit button hook. I have been unable to get this to occur during normal operation of ULabel, but instead have added a fix to prevent these empty layers from being present when delivered through the submit button.By adding an empty
[]layer to theresume_from.htmlin the demo, I confirmed that these get removed on load into ULabel when they are loaded in viaULabelAnnotation.from_json(). So now we perform the same operation when preparing annotations to be delivered when a submit button hook is called.I confirmed that this removes empty layers by adding the following code to
index.jsat line 353:When running the demo
resume_from.html, this forcibly adds an empty layer to one of the annotations after it has been initialized. I confirmed that pressing theSubmitbutton successfully removes the empty layer in the delivered annotations.PR Checklist
package.jsonhas been bumped since last releasepackage.jsonandsrc/version.jsnpm installandnpm run buildAFTER bumping the version numberapi_spec.md)changelog.mdBreaking API Changes
no thanks