Flower Species Classifier using TensorFlow.
In this repo, I used TensorFlow to build VGG16 Neural Network and train it from scratch using the 102 Category Flower Dataset, a dataset consisting of 102 flower categories.
- categories_names.json: a json file conaining the flowers/categories names.
- prepocessing.py: the code used to preprocess the images.
- run_training.py: the code used to launch the training.
- test.py: the code used to test the model once it is trained.
- train.py: the code used to train the model.
- utils.py: a python file containing utils functions.
- vgg_16.py: the code used to build the VGG16 model.
- requirements.txt: a text file containing the needed packages to run the project.
1. Prepare the environment:
NB: Use python 3+ only.
Before anything, please install the requirements by running: pip3 install -r requirements.txt
.
2. Prepare the data:
Download the 102 Category Flower Dataset available via this link.
Extract all the files into a flower_data/
directory.
The extracted data into flower_data/
should be organized as follows:
flower_data/
should contain three folders named train/
, test/
and valid/
.
Optional: you can convert all the dataset into npy file by uncommenting lines 33 and 34 of preprocessing.py
.
3. Train the VGG16 model: (from scratch)
To train the model, run python3 run_training.py
.
The trained model will be saved to a directory named model/
.
4. Test the model:
To test your trained model, run python3 run_testing.py
. Don't forget to change the image's and the model's paths.