convert a group of images in 'n' folders to dataset (eg: Mnist), to work with CNN

43 views Asked by At

I am trying to convert images generated in to a dataset.
(All I have is just png images in n folders and there is no label or meta data)

This is what I aspire to do:

  1. I am using torch audio to convert audio formats to Mel spectrogram and save the images as png format. Status:done

  2. Now I have n number of folders(classes) with images so I am curious if I could convert the newly generated images into data and target as in normal datasets, so that I can use sklearn to do the test train splits sklearn.model_selection.train_test_split . Status:not done

eg: fetch mnist dataset

ds_mnist = sklearn.datasets.fetch_openml(
     data_id=554,
     as_frame=False
 )

Split data and target in to X and y

dataset_X = ds_mnist .data.astype('float32')

dataset_y = ds_mnist .target.astype('int64')
0

There are 0 answers