-
Notifications
You must be signed in to change notification settings - Fork 446
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
Improve polygon utils #3707
Improve polygon utils #3707
Conversation
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, i left minor 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.
Thanks for your work. Could you update integration test result? and I left some comments. Please take a look.
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. But could you compare data time only? It doesn't look like the performance improvement is evident.
(Of course, I think there is good improvement because reallocating dm.Polygon which was a bottleneck disappeared.)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3707 +/- ##
===========================================
- Coverage 80.54% 80.47% -0.08%
===========================================
Files 255 255
Lines 25835 25829 -6
===========================================
- Hits 20810 20787 -23
- Misses 5025 5042 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
@wonjuleee , could you briefly describe what exactly here helps to reduce time and raise metrics? Because as I see it is just some refactoring done. Did you check it with different seeds and data?
UPD: I got it, thanks :)
Hi Kirill, thank you for the question. Previously, it used to create a new dm.Polygon annotation for each annotation, but it takes some converter logics described in https://github.com/openvinotoolkit/datumaro/blob/6a9227694fc4bac0883269974118dfd318bc573d/src/datumaro/components/annotation.py#L687. So, I turned to reuse the existing dm.Polygon annotation and update only the points for the augmentations (random crop/resize/flip). |
Summary
Creating dm.Polygon is not compute-efficient way because of running annotation validation.
So, through this PR, I would like to reuse the current dm.Polygon annotations instead.
With RTMDet-Tiny model on large instance segmentation dataset (5 times repeat), I can reduce 2.5% iteration time on average.
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.