-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Bugfix - same output for PIL and tensor when centercrop size is greater than imgsize #3333
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
Bugfix - same output for PIL and tensor when centercrop size is greater than imgsize #3333
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.
Looks good, thanks @saurabheights !
A nit comment to improve the code a bit
Codecov Report
@@ Coverage Diff @@
## master #3333 +/- ##
==========================================
- Coverage 73.90% 73.88% -0.02%
==========================================
Files 104 104
Lines 9618 9624 +6
Branches 1544 1546 +2
==========================================
+ Hits 7108 7111 +3
- Misses 2028 2030 +2
- Partials 482 483 +1
Continue to review full report at Codecov.
|
…nal.com:saurabheights/vision into bugfix/center-cropsize-greater-imgsize
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.
Looks good, thanks @saurabheights !
Just a nit remark about randomness in the tests. I know that it was already there and you replicated that, but from a practical point of view it will be hard to debug random parameters... Anyway, this improvement can be addressed in future.
@vfdev-5 Just setting Also, regarding drop in coverage, not 100% sure but I think it comes from other tests testing center crop method but not using test condition of cropsize>imgsize. However, adding test conditions to other tests would take me some time. |
@saurabheights let's ignore codecov failure.
Yes, I understand. Anyway, let's do it in another PR. My remark about both random params: even_image_size and delta. |
…er than imgsize (#3333) Summary: * Renamed original method to test center crop * Added test method, docs and added padding when imgsize < cropsize. * BugFix - keep odd_crop_size odd * Do not crop when image size after padding matches crop size; updated test. Reviewed By: datumbox Differential Revision: D26226610 fbshipit-source-id: d1697edc05f4dfe3469443ca88428a6466cc7eee Co-authored-by: Vasilis Vryniotis <[email protected]>
This PR fixes #3297