-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for multi-channel images in PyTorchObjectDetector #1633
Conversation
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Codecov Report
@@ Coverage Diff @@
## dev_1.10.1 #1633 +/- ##
===========================================
Coverage 88.09% 88.10%
===========================================
Files 259 259
Lines 21328 21328
Branches 3779 3779
===========================================
+ Hits 18788 18790 +2
+ Misses 1597 1596 -1
+ Partials 943 942 -1
|
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.
Hi Beat, I just had a minor comment, but otherwise looks good!
@@ -214,7 +214,7 @@ def _get_losses( | |||
x_grad.requires_grad = True | |||
else: | |||
x_grad = x[i].to(self.device) | |||
if x_grad.shape[-1] in [1, 3]: | |||
if x_grad.shape[2] < x_grad.shape[0] and x_grad.shape[2] < x_grad.shape[1]: |
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.
Could we keep the channels_first variable to allow manual configuration of the channels, and if it is not supplied, infer the channel number via this logic? There could be unusual cases in which the channels are more than one of the height/width dimensions of the 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 agree. For this patch release we decided to keep the channels_first
unused, but update the documentation accordingly, with the goal not to break the estimator. I agree, there could be images with more channels than pixels in height and width. All the models supported by this estimator are expecting channels first, therefore we should update the channels_First
argument` for ART 1.11, I have opened issue #1637.
Signed-off-by: Beat Buesser beat.buesser@ie.ibm.com
Description
This pull request adds support for multi-channel images in
PyTorchObjectDetector
.Fixes #1630
Type of change
Please check all relevant options.