-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Updated inceptionV3 to accept different sized images #718
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
Conversation
The update allows inceptionV3 to process images larger or smaller than prescribed image size (299x299).
Codecov Report
@@ Coverage Diff @@
## master #718 +/- ##
==========================================
+ Coverage 38.99% 39.61% +0.61%
==========================================
Files 29 29
Lines 2721 2724 +3
Branches 411 430 +19
==========================================
+ Hits 1061 1079 +18
+ Misses 1579 1571 -8
+ Partials 81 74 -7
Continue to review full report at Codecov.
|
fmassa
left a 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 the PR!
I have a few comments, but I'd be willing to merge the PR if you address those.
| # 8 x 8 x 2048 | ||
| x = F.avg_pool2d(x, kernel_size=8) | ||
| adaptiveAvgPoolWidth = x.shape[2] | ||
| x = F.avg_pool2d(x, kernel_size=adaptiveAvgPoolWidth) |
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.
isn't it simpler to just use F.adaptive_avg_pool2d(x, 1) here?
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.
Adaptive avg pool wasn't working in my local implementation due to pytorch version incompatibility, as you would be knowing from the issue (#696), so I implemented a workaround around it. From your above question it seems that that the latest pytorch release has the Adaptive avg pool so your suggestion is indeed a better implementation. Should I make this change in my PR?
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.
Please have a look at the new PR (#744 (comment)).
| # 5 x 5 x 128 | ||
| x = self.conv1(x) | ||
| adaptiveAvgPoolWidth = x.shape[2] | ||
| x = F.avg_pool2d(x, kernel_size=adaptiveAvgPoolWidth) |
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.
Same here, isn't it simpler to just use the adaptive version?
|
superseeded by #744 |
The update allows inceptionV3 to process images larger or smaller than prescribed image size (299x299). Will be useful while finetuning or testing on different resolution images.