Added automatic clipping for normalized annotations #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now values that should be normalized in [0,1] range for annotations are automatically clipped to this if not already.
Reason behind it is that even official COCO dataset includes values that are outside of [0,1] range when automatically normalized and thus the automatic parsing fails. If automatic clipping is added then we save user the effort to manually go through all annotations, find specific annotation where this happens and fix it.
Obvious downside is that now the validation would pass even if user doesn't actually pass normalized values because they would be clipped automatically to correct range - let me know if you have a better solution for this.
But IMO the upside is greater because automatic parsing failing just because one value is 1.001 instead of 1 is quite annoying.