Home » Python » python – Image Labeling from a different csv file-Exceptionshub

python – Image Labeling from a different csv file-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I have a dataset of images, and a CSV file contains the name and the label of the images (every label in CSV file corresponding to an image based on its name).
I want to group the images into specific folders of that particular label. Is there any way to do it? Please help me.

I have a ‘Train’ directory containing all the training image samples.
I have a train.csv containing two columns one image_id and corresponding class labels. How to group the training images into a folder according to the class label?

Suppose I have 4 classes. So I want to make 4 folders containing training images of each class.
enter image description here

Here is my CSV file looks like:
Here are my training images looks like:
enter image description here

How to&Answers: