-
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
Allow for transforms.ToTensor to return a Tensor of type torch.uint8 #1595
Comments
Hi @r-zenine as of now images in
That is great. You could look at issues tagged with From your comment, I'm not sure if you know how to implement a custom transformation that does what you want. If you need help, feel free to ask about it in another comment. |
Hi @pmeier, I wanted to be as respectful as possible in my comment as not to overstep. Since I am fairly new to Torchvision, I assumed I might not be aware of some design decisions taken by the project and I did not want to be rude! What is the rationale behind wanting only @pmeier Thanks for suggesting #1375, I will take a look this week-end and try to put something together and maybe ask questions here if I need to. |
Hi @r-zenine , Thanks for opening the issue! As @pmeier pointed out, we currently always return float tensors between 0 and 1. This is good for consistency: all images are float in 0-1. The discussion that @pmeier mentioned I believe is #1179 Have a look and let me know your thoughts! |
Hi @fmassa, Thank you very much for your response. I am sorry, I would've liked to look at it now. Unfortunatly, I am a bit short on time today and tomorrow. If it's okay for you ? I will take a look at everything this week-end and share my thoughts. Thanks, |
@r-zenine there can be also an option to use a custom vision/references/segmentation/transforms.py Lines 78 to 82 in 1aef87d
Let me close the issue as stale, @r-zenine feel free to reopen if you need more help on that. Thanks ! |
Hi Everyone,
This is my first issue in the project. Please forgive me if I overstep.
I would like to have the ability when I transform PIL images using Torchvision to get back a uint8 Tensor.
I am reimplementing a flavor of DQN with experience replay where I have to store frames of an atari game in a big buffer. Storing these tensors as uint8 as opposed to floats allows me to save some memory and have bigger buffers.
I don't know if it is the feature requested is even relevant for you and whether it makes sense to update ToTensor to do it.
I would like to contribute to PyTorch more in the future because I am a big fan of this piece of technology and would be willing to do the work as my first modest contribution if you think this can be useful.
Thank you all
The text was updated successfully, but these errors were encountered: