Inception V3 for Transfer Learning on Cats and Dogs
File to train the Inception v3 model on any dataset is added(transfer.py
)
I have added the weights file and the predict file(predict.py
)
Recommended to use Anaconda 3
Dependencies:
- Tensorflow = 1.2.1
- Keras = 2+
Installing Tensorflow-cpu :
pip install tensorflow
Installing keras:
pip install keras
Transfer-Learning
| inception.model
| README.md
| predict.py
| transfer.py
|__test_set
| |__cats
| | cat01.jpg
| | cat02.jpg
| | ...
| |__dogs
| | dog01.jpg
| | dog02.jpg
| | ..
|
|
|__training_set
| |__cats
| | cat01.jpg
| | cat02.jpg
| | ...
| |__dogs
| | dog01.jpg
| | dog02.jpg
| | ..
-
Add the files in training_set and test_set
-
Run
python transfer.py --nb_epoch 5 --batch_size 320 --plot --output_model_file filename.model
-
Later use the saved weights to predict any Image of cat or dog from the Internet or saved Images.
-
For Images saved locally
python predict.py --image imagename.jpg --model_name inception.model
-
For Images on the net
python predict.py --image_url www.imagename.jpg --model_name inception.model