How can I label images for classification based on image name?

10 visualizzazioni (ultimi 30 giorni)
I want to carry out transfer learning for classification using squeezeNet for a set of images. All the images are stored in one folder and I want to classify each image based on its name (file name). For example, if the image name is '1.jpg' , its label will be '1'. so if I have 500 images in the folder , I want the network to realize that I have 500 classes. I used deep network designer in Matlab and I import data as the folder of images, then I got this training data distribution which means that all the images will be classified as one class called 'high' !!!!!. Does anyone know how to label the images based on image name in the folder? Thanks.

Risposte (1)

Ajith Krishna Kanduri
Ajith Krishna Kanduri il 18 Giu 2020
Modificato: Ajith Krishna Kanduri il 18 Giu 2020
Hi Sandoub,
I have understood you are facing issue in labeling the images. You can refer the following link for more information about loading data in the Deep Network Designer.
You can see in the import data tab there is an option “Select a folder with subfolder of images for each class”. Images in the subfolder are categorized into classes. Since you are using all the images from one folder, they are categorized into one class. If you want to have 500 classes, then you can use 500 subfolders.
  1 Commento
ghada sandoub
ghada sandoub il 18 Giu 2020
I already think about that, however, it is very hard task to do this manually ( use 500 subfolders and put one image in each subfolder). Did you know a simple way to do this?

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by