Datasets:

Languages:
English
ArXiv:
License:

25th image in train set is Gray-Scale

#2
by doolayer - opened

Hi~
I found that 25th image in train set is Gray-scale.
I mean it's image mode is in "L", not a RGB!
So, I put converting code on transform function when I use it.
Maybe there will be more Gray-Scale images in datasets...

image.png

simply do this

 for batch in self.source:
            # Skip any None elements in the batch list
            batch = [x for x in batch if x is not None]

           # Resize the tensors to a common size and ensure they have the same number of channels
        processed_batch = []
        for item in batch:
            data, label = item
            # Convert single-channel images to RGB
            if data.size(0) == 1:
                data = data.repeat(3, 1, 1)
            elif data.size(0) == 4:
                data = data[:3]
            processed_batch.append((data, label))

Sign up or log in to comment