Creating an Image database

Good day all,
I have pictures I snapped on my phone, I want to make a Neural Network project with it. Please how can I convert it to database and annotate it in which it can be usable in python.


If you want to make a snapped photos to be data base or training data to make classification …you should classify your data by your self for example if you have snap photos of cats and any this else …and you want to make binary classification if cat the output =1 else output =0 .first you want to create 2 folder in your PC .the first folder called cats and you put all cat photos on it . anther folder called ant thing else and you put all photos except cat photos … So if you have snapped photos you should make a folders of what you want to classify

This link should how to import it
tf.keras.utils.image_dataset_from_directory | TensorFlow v2.10.0

I hope it help you,
Please feel free to ask any question,

1 Like

Thank you very much for the guide.
How Can I contact you privately?
Fore more clearer explanations

Notice that @AbdElRhaman_Fakhry doesn’t explicitly say it, but the described approach is not literally a database. Rather, it is a set of image files with the classification value(s) implied by the folder structure into which the files are placed. It is also common to find labelled training data where each image file has an associated record in an structured text, XML or JSON, file. That record contains information about the image, including things like the collection of objects within the image (location and type) and ambient conditions (day/night, weather, etc). Sometimes you find data where each image file has its own associated XML or JSON file.

There is a helpful tutorial on the TensorFlow dataset approach here:

Notice particularly this section…

This tutorial uses a dataset of about 3,700 photos of flowers. The dataset contains five sub-directories, one per class:

1 Like

In tensorflow world, the closest thing you get to a database is a compressed representation of the underlying dataset. The Dataset#save API lets you save the dataset which could be better than carrying around a lot of files around. In the world of big data, small files problem is something to be aware of.


@ai_curious Thank you very much for the guide.
How Can I contact you privately?
Fore more clearer explanations