Skip to content

A binary image classifier to accept user input as image and predict wheather it's a mango or jackfruit.

Notifications You must be signed in to change notification settings

Ajmalva/TriCode-Fruits-image-classifier

Repository files navigation

TriCode-Fruits-image-classifier

A binary image classifier to accept user input as image and predict wheather it's a mango or jackfruit.

https://tricode.herokuapp.com/

BFH Banner

TriCode

In this project, I built a python application that uses a train image classifier model on a dataset, then predict the class of new images This project is divided to two parts:

Part 1 - Developing an Image Classifier in colab

In this first part of the project, I implemened an image classifier with data sets of JackFruit and Mango from drive to train the model.

Part 2 - Building the flask application

Build a pair of Python scripts that run from the command line to run the image classifier and to predict new images using the trained model.

Team members 🙋

  1. Ajmal V A [https://github.com/Ajmalva]
  2. Alvin Antony [https://github.com/A-L-V-I-N]
  3. Ancy Paul [https://github.com/smile-10]

Team Id 🔑

 BFH/recSYFS77S94PHQFg/2021

Link to product walkthrough 📺

Watch the video (https://qrgo.page.link/wPBxC)

Live URL 📡

We have deployed the current model to Heroku You can See the webapp here: https://tricode.herokuapp.com/

Libraries used 📚

This project requires Python 3.x and the following Python libraries installed:

How to configure 🔧

How to Run

Run with Docker

With Docker, you can quickly build and run the entire application in minutes 🐳

# 1. First, clone the repo
$ git clone https://github.com/Ajmalva/TriCode-Fruits-image-classifier.git
$ cd keras-flask-deploy-webapp

# 2. Build Docker image
$ docker build -t keras_flask_app .

# 3. Run!
$ docker run -it --rm -p 5000:5000 TriCode-Fruits-image-classifier

Open http://localhost:5000 and wait till the webpage is loaded. 😁

Local Installation

It's easy to install and run it on your computer.

# 1. First, clone the repo
$ git clone https://github.com/Ajmalva/TriCode-Fruits-image-classifier.git
$ cd TriCode-Fruits-image-classifier

# 2. Install Python packages
$ pip install -r requirements.txt

# 3. Run!
$ python app.py

Open http://localhost:5000 and have fun. 😃

Customization 💻

It's also easy to customize the ui and include your own models in this app.

Details

Use your own model

Place your trained .h5 file saved by model.save() under models directory.

Use other pre-trained model

See Keras applications for more available models such as DenseNet, MobilNet, NASNet, etc.

UI Modification

Modify files in templates and static directory.

index.htmland style.css for the UI and control.js for all the behaviors.

Deployment 🔌

To deploy it for public use, you need to have a public linux server.

Details

Run the app

Run the script and hide it in background with tmux or screen.

$ python app.py

You can also use gunicorn instead of gevent

$ gunicorn -b 127.0.0.1:5000 app:app

More deployment options, check here

Set up Nginx

To redirect the traffic to your local app. Configure your Nginx .conf file.

server {
  listen  80;

  client_max_body_size 20M;

  location / {
      proxy_pass http://127.0.0.1:5000;
  }
}

About

A binary image classifier to accept user input as image and predict wheather it's a mango or jackfruit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •