Giter VIP home page Giter VIP logo

tf-image-classifier-api's Introduction

Custom Image Classification API

This is a Custom Image Classification API built from scratch. The Custom Neural network is built with TensorFlow v1.

Don't forget to ⭐ this repo!

Table of Contents πŸ““

Installation ⬇️

  • Use this command to clone this repository: https://github.com/siddheshgunjal/TF-Image-Classifier-API.git
  • Create environment with your environ management tool, Virtualenv or Conda
  • Install packages with pip using pip install -r requirements.txt

Usage βš™οΈ

Download training images for your task

To download training images for your classes you can utilise the python script from this gist. Procedure to use it is as below:

  • Download chrome driver for your system from this link: chromedriver
  • Open python script and add path to chromedriver at line 11 or just uncomment the path for already included chromedriver for linux/windows.
  • Run scrapper with python img_scrapper.py in terminal.
  • Enter the search term (For example: Tiger)
  • Enter the number of images to download (For example: 50)
  • The script will then launch Google Chrome and start scrapping process. Wait till the scrapping process is complete.
  • You can find the all the scrapped images in ./Data/Train_data/search_term
  • You can download as many images as you want for as many classes.

Train Neural Network

  • Put all your training data with folder for each class in ./Data/Train_data/class_name
  • Start training with python train.py. Default epochs to train are set to 100. you can change it as per your need from line 48 in train.py
  • You can also visualize training progress with tensorboard using tensorboard --logdir Checkpoints/logs
  • After training finishes, you'll get 2 files
    • model.json: Neural Network architecture
    • weights.h5: Updated weights of neural network after training

Run Prediction from browser

1. Run application with Flask's in-built server:

Use python app.py in terminal. This will start our application at localhost:8188

OR

2. Run application with Gunicorn server:

Use gunicorn -b :8188 -c gunicorn.conf.py app:app in terminal. This will start our application at localhost:8188

Visit this URL in browser and you should see the message, Image Classification API is running. This verifies that our API is running at server side. Go to localhost:8188/classification for prediction task: classification page Drag your image in the drop zone or upload it and click Run Prediction, which will then run the prediction and show you the result with below screen: classification-result page classification-result page

Your Custom Image classification API is ready!

Deploy on AWS with Docker πŸš€

Please Refer AWS docker setup guide to deploy this application on AWS EC2 instance with docker.

Support ✨

If you get stuck, we’re here to help. The following are the best ways to get assistance working through your issue:

  • Use our Github Issue Tracker for reporting bugs or requesting features. Contribution are the best way to keep this repo amazing πŸ’ͺ
  • If you want to contribute please refer Contributor's Guide for how to contribute in a helpful and collaborative way πŸ˜‡

Author 😎

Siddhesh Gunjal

tf-image-classifier-api's People

Contributors

siddheshgunjal avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

sachinmundhe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.