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

Move from PIL to torchvision.io.decode_image #2303

Open
ebsmothers opened this issue Jan 28, 2025 · 3 comments
Open

Move from PIL to torchvision.io.decode_image #2303

ebsmothers opened this issue Jan 28, 2025 · 3 comments
Assignees
Labels
best practice Things we should be doing but aren't community help wanted We would love the community's help completing this issue

Comments

@ebsmothers
Copy link
Contributor

Instead of using PIL.open, @NicolasHug has pointed out that we can move to torchvision.io.decode_image to speed up image processing by doing everything on pure tensors (see also. This would also allow us to drop our explicit PIL requirement). This should entail:

  1. changing load_image to use torchvision.io.decode_image
  2. updating CLIPImageTransform to accept tensors instead of PIL.Image (in the short term we can keep PIL.Image support for backwards compatibility)
@ebsmothers ebsmothers added best practice Things we should be doing but aren't community help wanted We would love the community's help completing this issue labels Jan 28, 2025
@Ankur-singh
Copy link
Contributor

@ebsmothers Can you please assign this to me?

Thank you 😁

@ebsmothers
Copy link
Contributor Author

@Ankur-singh just assigned it to you, thanks for taking it on!

@NicolasHug
Copy link
Member

Feel free to ping me for help / reviews / best practices!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice Things we should be doing but aren't community help wanted We would love the community's help completing this issue
Projects
None yet
Development

No branches or pull requests

3 participants