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

Resolve issue #267 #283

Merged
merged 7 commits into from
Jan 21, 2022
Merged

Resolve issue #267 #283

merged 7 commits into from
Jan 21, 2022

Conversation

nightlessbaron
Copy link
Contributor

@nightlessbaron nightlessbaron commented Nov 10, 2021

Description

Fixes #267

As discussed with @seba-1511, adds an option for RGB bands for Random Rotation.

Contribution Checklist

If your contribution modifies code in the core library (not docs, tests, or examples), please fill the following checklist.

  • My contribution is listed in CHANGELOG.md with attribution.
  • My contribution modifies code in the main library.
  • My modifications are tested.
  • My modifications are documented.

@nightlessbaron
Copy link
Contributor Author

One more thing that can be added is a try-catch for the older version of torchvision.
It seems that the tests are failing for the same reason. Let me know if I should add it @seba-1511

@seba-1511
Copy link
Member

seba-1511 commented Nov 10, 2021

Thanks for this PR @nightlessbaron!

Yes, catching the exception for older versions is a good idea. Some more comments from a quick glance at the code:

  • I think you can remove Compose around the random rotation (but you'll need it for older versions when converting to and from PIL).
  • The tests you included already look great. Could we also have a few small unit tests that don't require a dataset (you can pass a 4-dim random tensor instead of real images)?

Let me know when it's ready for a full review, and thanks again.

@nightlessbaron
Copy link
Contributor Author

@seba-1511, thanks for your review. I have incorporated the changes you suggested.
Can you have a final check again? Thank you!

@seba-1511
Copy link
Member

@nightlessbaron, this looks great and looks ready to merge -- thanks for persisting! Do you want to add a line to CHANGELOG.md and credit yourself?

@nightlessbaron
Copy link
Contributor Author

Thanks, @seba-1511, it's done.

@seba-1511 seba-1511 merged commit e06f682 into learnables:master Jan 21, 2022
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.

ValueError: The number of elements in 'fill' does not match the number of bands of the image (1 != 3)
2 participants