grayscale images not loading using hugging face and ViT

91 views Asked by At

I am have an images dataset in grayscale format. Now i want to classify it using Vision transformers and hugging face. The dataset is in google drive but the problem is that i cannot read the images. What would be the possible reasons? I use the following code to read the image.

from datasets import load_dataset
dataset = load_dataset("ImageFolder", data_dir="/content/Xray8_New_DataSet")

Images reading from google drive using ViT and Hugging face.

1

There are 1 answers

0
cronoik On

Be careful with the spelling. The dataset builder name is lowercased imagefolder:

from datasets import load_dataset
d = load_dataset("imagefolder", data_dir="/home/cronoik/downloads/bla/")