Code Monkey home page Code Monkey logo

crop-disease-classification's Introduction

Automated classification of tomato plant disease

Deep learning based automated tomato plant disease classification covering over 40 disease classes and 4 healthy classes.

Get Started

Instal python virtualenv

sudo apt install virtualenv virtualenv --system-site-packages -p python3 py35

Activate the python virtualenv (run from root)

source py35/bin/activate

Install dependencies

sh requirements.sh

Note:

  1. To setup nginx properly, follow the setup tutorial here: https://www.matthealy.com.au/blog/post/deploying-flask-to-amazon-web-services-ec2/

  2. Delete the default nginx page
    sudo rm /etc/nginx/sites-enabled/default

  3. Restart the nginx server
    sudo service nginx restart

Project tree

Training the image-classification model

Activate the python virtualenv (run from root)

source py35/bin/activate

Change the dir to crop_classifcation_updated

cd KisanLab_CPU

Train the inceptionV3 model (more accurate, larger size, slow to train)

sh train.sh

or

Train the mobilenet model (less accurate, smaller size, fast to train)

sh train_mobilenet.sh

API

Kisan_app folder contains all the files for the API.

How to run the API?

Start the server (run from root)

source py35/bin/activate

Change dir to server dir

cd crop_classification_updated/kisan_app

Start the server (logging occurs in nohup.out file)

nohup gunicorn app:app -b localhost:8000 &

Access API via curl cmd

curl -F file=@/path/to/your/image ${PUBLIC_IP_OF_EC2_INSTANCE}/api_call

Output (in json)

[ { "Prediction1": "tomato fruit borer", "Confidence1": "0.490311", "Confidence2": "0.258647", "Prediction2": "cutworm on tomato" } ]

or

Access the web-api via the public IP of the ec2 instance

Output

Alt text

crop-disease-classification's People

Contributors

gauravkaila avatar

Watchers

 avatar

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.