A binary image classifier to accept user input as image and predict wheather it's a mango or jackfruit.
https://tricode.herokuapp.com/
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:
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.
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.
- Ajmal V A [https://github.com/Ajmalva]
- Alvin Antony [https://github.com/A-L-V-I-N]
- Ancy Paul [https://github.com/smile-10]
BFH/recSYFS77S94PHQFg/2021
(https://qrgo.page.link/wPBxC)
We have deployed the current model to Heroku You can See the webapp here: https://tricode.herokuapp.com/
This project requires Python 3.x and the following Python libraries installed:
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. 😁
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. 😃
It's also easy to customize the ui and include your own models in this app.
Details
Place your trained .h5
file saved by model.save()
under models directory.
See Keras applications for more available models such as DenseNet, MobilNet, NASNet, etc.
Modify files in templates
and static
directory.
index.html
and style.css
for the UI and control.js
for all the behaviors.
To deploy it for public use, you need to have a public linux server.
Details
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
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;
}
}