Skip to content

No support for multi-channel images #882

@adamjstewart

Description

@adamjstewart

Multi-channel images are common in the fields of satellite remote sensing (GIS) and in medical imaging. Many of the multispectral satellites I work with in my research have 8+ spectral bands, not just RGB. Some hyperspectral satellites have as many as 136 spectral bands. Microscopy often involves 4+ channel images as well.

Currently, torchvision relies on the Python Imaging Library (PIL) for all of its transforms. Unfortunately, pillow does not support multi-channel images: python-pillow/Pillow#3160, python-pillow/Pillow#1888

The way I see it, researchers such as myself have 3 options:

  1. Fix PIL (unlikely, as Add support for high bit depth multichannel images python-pillow/Pillow#1888 has been stalled for 3 years now)
  2. Fix torchvision (this would involve implementing all of the current transforms by hand using torch Tensors or numpy arrays)
  3. Fork torchvision (write all of the transforms we need ourselves)

I'm about to resort to 3 for my research. Do you have any suggestions for users like me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions