项目作者: DhavalThkkar

项目描述 :
Inception V3 for Transfer Learning on Cats and Dogs
高级语言: Python
项目地址: git://github.com/DhavalThkkar/Transfer-Learning.git
创建时间: 2017-08-26T16:33:01Z
项目社区:https://github.com/DhavalThkkar/Transfer-Learning

开源协议:MIT License

下载


Transfer-Learning

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)

Instructions to use the predict file:

Recommended to use Anaconda 3

Dependencies:

  1. Tensorflow = 1.2.1
  2. Keras = 2+

Installing Tensorflow-cpu :
pip install tensorflow

Installing keras:
pip install keras

Project file structure

  1. Transfer-Learning
  2. | inception.model
  3. | README.md
  4. | predict.py
  5. | transfer.py
  6. |__test_set
  7. | |__cats
  8. | | cat01.jpg
  9. | | cat02.jpg
  10. | | ...
  11. | |__dogs
  12. | | dog01.jpg
  13. | | dog02.jpg
  14. | | ..
  15. |
  16. |
  17. |__training_set
  18. | |__cats
  19. | | cat01.jpg
  20. | | cat02.jpg
  21. | | ...
  22. | |__dogs
  23. | | dog01.jpg
  24. | | dog02.jpg
  25. | | ..

Operations with transfer.py

  1. Add the files in training_set and test_set

  2. Run python transfer.py --nb_epoch 5 --batch_size 320 --plot --output_model_file filename.model

  3. Later use the saved weights to predict any Image of cat or dog from the Internet or saved Images.

Operations for predict.py

  1. For Images saved locally
    python predict.py --image imagename.jpg --model_name inception.model
  1. For Images on the net
    python predict.py --image_url www.imagename.jpg --model_name inception.model