-
Notifications
You must be signed in to change notification settings - Fork 307
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
[Feature] Crop Transform #2336
[Feature] Crop Transform #2336
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2336
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 14 Unrelated FailuresAs of commit 07e4e1a with merge base 0063741 (): NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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, just a couple of minor issues
Thanks for this!
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Co-authored-by: Vincent Moens <vincentmoens@gmail.com>
Thanks a lot for the quick review!! I fixed the issues |
Description
Currently TorchRL has a CenterCrop transform. I have recently encountered a situation were I did not want to crop the center, but another part of the obs image.
For cases like this one, it would be interesting to have a Crop transform too, that allows to define the specific location of the cropping.
This super simple PR adds it. For the tests I have pretty much used the same as CenterCrop, as it is simply a more general Transform where the cropping location can be modified.
I thought about simply having single Transform for both cases (e.g. default behaviour is center crop but the starting location can be optionally provided). However, imo it is cleaner and more intuitive to have both.
Motivation and Context
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax
close #15213
if this solves the issue #15213Types of changes
What types of changes does your code introduce? Remove all that do not apply:
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!