Skip to content

Move from PIL to torchvision.io.decode_image #2303

Open
@ebsmothers

Description

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)

Metadata

Assignees

Labels

best practiceThings we should be doing but aren'tcommunity help wantedWe would love the community's help completing this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions