Skip to content
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 HRNet dimension error on images with alpha channel #5570

Merged
merged 3 commits into from
Jan 11, 2023

Conversation

rodrigoberriel
Copy link
Contributor

@rodrigoberriel rodrigoberriel commented Jan 11, 2023

This is pretty much the same fix applied to f-BRS in #5384. We've been using HRNet for a while and now an then we receive "500 errors" just as reported in #5299 when someone forgets to drop the alpha-channel from our images.

Motivation and context

The RuntimeError is a little bit different, but comes from the same issue: RGBA instead of RGB images:

RuntimeError: Given groups=1, weight of size [16, 3, 1, 1], expected input[*, 4, *, *] to have 3 channels, but got 4 channels instead.

How has this been tested?

I created a task with images with and w/o alpha channel, and the interactor works on both now.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodrigoberriel , thanks for the contribution.

@nmanovic nmanovic merged commit 43ed0a2 into cvat-ai:develop Jan 11, 2023
@rodrigoberriel rodrigoberriel deleted the fix-hrnet-on-rgba-images branch January 11, 2023 23:49
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
This is pretty much the same fix applied to f-BRS in cvat-ai#5384. We've been
using HRNet for a while and now an then we receive "500 errors" just as
reported in cvat-ai#5299 when someone forgets to drop the alpha-channel from
our images.

### Motivation and context
The RuntimeError is a little bit different, but comes from the same
issue: RGBA instead of RGB images:
> RuntimeError: Given groups=1, weight of size [16, 3, 1, 1], expected
input[*, 4, *, *] to have 3 channels, but got 4 channels instead.

### How has this been tested?
I created a task with images with and w/o alpha channel, and the
interactor works on both now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants