Skip to content
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

Added automatic clipping for normalized annotations #177

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

klemen1999
Copy link
Contributor

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.

@klemen1999 klemen1999 requested a review from a team as a code owner October 2, 2024 09:51
@klemen1999 klemen1999 requested review from kozlov721, tersekmatija and conorsim and removed request for a team October 2, 2024 09:51
@github-actions github-actions bot added the fix Fixing a bug label Oct 2, 2024
@klemen1999
Copy link
Contributor Author

Note: Tests are failing because of onnx version (fixed in #176 ) because yesterday onnx==1.17.0 came out and it looks like there are some breaking changes.

@tersekmatija
Copy link
Collaborator

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

Could we raise a warning or fail if value would be > 2.0? This would mean that annotations are unlikely normalized, while small "overflows" like 1.002 would be still correctly clipped.

@klemen1999
Copy link
Contributor Author

Could we raise a warning or fail if value would be > 2.0? This would mean that annotations are unlikely normalized, while small "overflows" like 1.002 would be still correctly clipped.

Yeah I think this makes sense. I'll add the max allowed range to be [-2,2] for automatic clipping.

Copy link
Collaborator

@kozlov721 kozlov721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kozlov721 kozlov721 added the data Changes affecting luxonis_ml.data subpackage label Oct 3, 2024
@kozlov721 kozlov721 merged commit 71f58b5 into dev Oct 3, 2024
6 of 10 checks passed
@kozlov721 kozlov721 deleted the fix/anno_clipping branch October 3, 2024 17:51
@kozlov721 kozlov721 mentioned this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Changes affecting luxonis_ml.data subpackage fix Fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants