This bootstraps the training of deep convolutional neural networks with Keras to classify images in the Oxford 102 category flower dataset.
Train process is fully automated and the best weights will be saved.
The code can be used for any dataset, just follow the original files structure in data/sorted directory after running bootstrap.py
. If you want to store your dataset somewhere else, you can do it and run train.py
with setting a path to dataset with a special parameter --data_dir==/full/path/to/your/sorted/data
Dataset directory's structure
Notice: for ResNet152 you should download weights manually here and put them under the project_directory/weights
bootstrap.py
: downloads the Oxford 102 dataset and prepare image filestrain.py
: starts end-to-end training process server.py
: a small python server based on sockets and designed to keep a model in memory for fast recognition requestsclient.py
: a client that sends requests to server.pypython bootstrap.py
python train.py --model=resnet50
predict.py
or server.py
+ client.py
Using predict.py
:
python predict.py --path "/full/path/to/image" --model=resnet50
Using server.py
+ client.py
:
python server.py --model=resnet50
python client.py --path "/full/path/to/image"