项目作者: AbdulAhadSiddiqui11

项目描述 :
Its a convNet built upon InceptionV3 and trained on 928 pokemon classes.
高级语言: Jupyter Notebook
项目地址: git://github.com/AbdulAhadSiddiqui11/Pokemon-Image-Classifier.git
创建时间: 2019-09-04T17:03:36Z
项目社区:https://github.com/AbdulAhadSiddiqui11/Pokemon-Image-Classifier

开源协议:MIT License

下载


Pokemon-Image-Classifier

Its a convNet built upon InceptionV3 and trained on 928 pokemon classes. The model can predict any pokemon image till season 20 (Pokemon Sun and Moon)

Model details:
loss: 0.1279 - accuracy: 0.9743 - validation loss: 0.9940 - validation accuracy: 0.7917

Getting Started

Clone the repository to your local machine
Extract all the files into a directory
Run the Run_model.ipynb

Prerequisites

Dependencies :

  • cv2
  • Matplotlib
  • Tensorflow - gpu
  • keras
  • pillow
  • pickle
  • os
  • requests
  • io
    1. import cv2
    2. import matplotlib.pyplot as plt
    3. from keras.optimizers import Adam
    4. from keras.models import Model,load_model
    5. from keras.applications.inception_v3 import InceptionV3
    6. from keras.layers import Dense,Input,GlobalMaxPooling2D
    7. from keras.preprocessing.image import ImageDataGenerator
    8. from keras.callbacks import EarlyStopping,ReduceLROnPlateau
    9. import matplotlib.pyplot as plt
    10. import os
    11. from keras.models import load_model
    12. from os import path
    13. from os import listdir
    14. import numpy as np
    15. import requests
    16. from PIL import Image
    17. from io import BytesIO
    18. import pickle

Installing

Cv2

  1. $ pip install opencv-python (if you need only main modules)
  2. $ pip install opencv-contrib-python (if you need both main and contrib modules)

Matplotlib

  1. $ pip install matplotlib
  2. If you are on Linux, you might prefer to use your package manager. Matplotlib is packaged for almost every major Linux distribution.
  3. Debian / Ubuntu: sudo apt-get install python3-matplotlib
  4. Fedora: sudo dnf install python3-matplotlib
  5. Red Hat: sudo yum install python3-matplotlib
  6. Arch: sudo pacman -S python-matplotlib

Tensorflow GPU

  1. $ pip install tensorflow-gpu # stable
  2. $ pip install tf-nightly-gpu # preview
  3. You will also need to install CUDA drivers, for more details visit
  4. https://towardsdatascience.com/installing-tensorflow-with-cuda-cudnn-and-gpu-support-on-windows-10-60693e46e781

Keras

  1. These installation steps assume that you are on a Linux or Mac environment. If you are on Windows, you will need to remove sudo to run the commands below.
  2. $ sudo pip install keras
  3. $ pip install keras
  4. Alternatively: install Keras from the GitHub source:
  5. $ git clone https://github.com/keras-team/keras.git
  6. Then, cd to the Keras folder and run the install command:
  7. $ cd keras
  8. $ sudo python setup.py install

pillow

  1. $ pip install Pillow
  2. $ easy_install Pillow
  3. $ python setup.py install

Screen Shots :
Screenshot 1
Pikachu

Screenshot 2
Charmander

Screenshot 3
Darkrai

Screenshot 4
Kyurem(Black)

Deployment

Training the model

Detailed instructions on how to train this model are described in the jupyter notebook attached (‘PokeClassifier_Train.ipynb‘).

Using pre-trained weights

If you want to download and use the weights of this trained model follow the link below.

https://drive.google.com/file/d/1Zai3RoV7L7mX1AlUqqYgUHb1VHuQ3N5A/view?usp=sharing

Using the Model

You can directly run the app to predict the pokemon in an image

Instructions :

  1. Download the model.h5 from the link provided
    2(a). Download the pokemon_classes pickle file
    2(b). Download the dataset from the link provided (optional) to create the classes_list (skip this if you’re using the pickle file)
  2. Either run Run_model.ipynb or Run_model.py
    Note : Change the location of files if required.

Other details

Python files for all the notebooks are also provided, if you need .py scripts for some reason.

Contributing

Please read CODE_OF_CONDUCT.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details