Hi, I’m working on image classification. I have csv file which has image names, and their label mappings.
I tried as suggested here., but I want the image to be in the form of PIL format, and also labels has to be detected.
this is what I’m getting:
>> data_files = {'train': 'train.csv', 'test': 'test.csv'}
ds = load_dataset('csv', data_files=data_files, data_dir='/kaggle/input/cassava-leaf-disease-classification/train_images/')
>> ds
DatasetDict({
train: Dataset({
features: ['Unnamed: 0', 'image_id', 'label'],
num_rows: 17118
})
test: Dataset({
features: ['Unnamed: 0', 'image_id', 'label'],
num_rows: 4279
})
})
>>ds['train'].features
{'Unnamed: 0': Value(dtype='int64', id=None),
'image_id': Value(dtype='string', id=None),
'label': Value(dtype='int64', id=None)}
This is how I want it to be:
(this image is from a colab notebook provided by huggingface)
How can I get it right?