-
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
Added __repr__ to MultiScaleRoIAlign #2840
Conversation
torchvision/ops/poolers.py
Outdated
@@ -258,3 +258,6 @@ def forward( | |||
result = _onnx_merge_levels(levels, tracing_results) | |||
|
|||
return result | |||
|
|||
def __repr__(self) -> str: | |||
return f"{self.__class__.__name__}(output_size={self.output_size}, sampling_ratio={self.sampling_ratio})" |
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.
Maybe we can also add featmap_names
as it is also a user's input ?
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.
I was wondering what to do about this: I left it out, since I believe the FPN does not display it as well. But happy to reconsider, if you think it's a good addition 👌
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.
I just added so that it's comprehensive on this __repr__
at least
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 !
if you think it's a good addition
I have no strong opinion on that. Just thought that featmap_names
is a configuration provided by user and repr displays 2 of 3 its configs.
since I believe the FPN does not display it as well
Seems like there is no repr at all for FPN, https://github.com/pytorch/vision/blob/master/torchvision/ops/feature_pyramid_network.py
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! Thanks for the PR @frgfm !
Codecov Report
@@ Coverage Diff @@
## master #2840 +/- ##
==========================================
+ Coverage 73.35% 73.36% +0.01%
==========================================
Files 99 99
Lines 8785 8787 +2
Branches 1387 1387
==========================================
+ Hits 6444 6447 +3
Misses 1916 1916
+ Partials 425 424 -1
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!
* feat: Added __repr__ to MultiScaleRoIAlign * test: Added unittest for __repr__ of MultiScaleRoIAlign * feat: Added feature map names in __repr__ * test: Updated unittest Co-authored-by: vfdev <[email protected]>
* feat: Added __repr__ to MultiScaleRoIAlign * test: Added unittest for __repr__ of MultiScaleRoIAlign * feat: Added feature map names in __repr__ * test: Updated unittest Co-authored-by: vfdev <[email protected]>
Hello there 👋
I happen to be playing around with region pooling architectures lately, and printing the model in the console is useful to debug or figure out ways to improve the architecture. While
RoIPool
andRoIAlign
have useful__repr__
attributes, their multi-scale counterpart doesn't have any.I figured this isn't worth opening an issue, so here is what this PR does:
__repr__
attribute to theMultiScaleRoIAlign
classSuggestions are welcomed for the proposed formatting!