-
Notifications
You must be signed in to change notification settings - Fork 7k
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 transform for rcnns so original images list is unchanged #1084
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1084 +/- ##
==========================================
+ Coverage 63.92% 64.67% +0.74%
==========================================
Files 68 68
Lines 5406 5407 +1
Branches 829 829
==========================================
+ Hits 3456 3497 +41
+ Misses 1707 1661 -46
- Partials 243 249 +6
Continue to review full report at Codecov.
|
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 the PR!
I have a few comments.
Also, could you add tests for this case? Maybe in tests/test_models.py
transform does not change input list anymore. Improve code according to reviewer comment
transform for maskrcnn no longer modify input list. improve code according to 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!
Maskrcnn or fastrcnn pass input image list into the transform module in torchvision/models/detection/transform.py. However, the method modifies content in the list where transformed images are pasted back to corresponding entries of the input list.
As a result, user may meet unintended behavior when they hold reference to the original input list outside the maskrcnn call. The proposed change leave user input image list to the maskrcnn call unchanged.