I am new to Deep Learning. I have this question: I am trying to train a network with this data. Everything is in one folder and labels are in a different mat file.
I understand that I can read the data with scipy.io. But how can I get train X in one folder? If I use the built in flow_from_directory it shows no images, because every class should have it's own folder.
How can I create X with only one folder? Now it shows Found 0 images belonging to 0 classes
There is just a folder with images. All images are in 1 folder. I mean there is no classes folder. With flow_from_directory you should have something like cars/mercedes, cars/bmw, cars/audi, but my data doesn't have subfolders.
So my question is there any other way to create X data?
Set classes to None
and put all images into one subfolder of your image folder.
For example:
flow_from_directory(directory = "/path/to/your/images/", class_mode="None", …)
/path/to/your/images/data
The link you posted also shows a download link to "A devkit, including class labels for training images and bounding boxes for all images".
You'll find the information there that you need in order to transform your data set into the desired folder structure required for flow_from_directory()
.
From the README.md
-cars_meta.mat:
Contains a cell array of class names, one for each class.
-cars_train_annos.mat:
Contains the variable 'annotations', which is a struct array of length
num_images and where each element has the fields:
bbox_x1: Min x-value of the bounding box, in pixels
bbox_x2: Max x-value of the bounding box, in pixels
bbox_y1: Min y-value of the bounding box, in pixels
bbox_y2: Max y-value of the bounding box, in pixels
class: Integral id of the class the image belongs to.
fname: Filename of the image within the folder of images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With