Skip to content

tech-warriors-corporation/harvtech-vegetables-health-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vegetables Health

The AI project to assess the vegetables health.

Support vegetables:

  • Bean;
  • Potato;
  • Tomato;
  • Rice.

About models

We are using models from Kaggle.

Gemini API

You can get a Gemini API key in this link.

Environment setup

Create a .env file in the root folder with content:

CLOUD_STORAGE_URL_PREFIX=https://URL_TO_YOUR_STORAGE_DOMAIN/
FLASK_PORT=5001
GEMINI_API_KEY=YOUR_API_KEY_HERE
FLASK_ENV=production

Prepare

Download the best_tomato_leaf_inceptionV3_256.h5 and best_rice_leaf.h5, into the constants/weights directory.

Install and download models

Use pip install -U -r requirements.txt to install dependencies.

Use ./download_models.sh to download the trained models

Install certificates

If want to use self-certificates, run the next script to build them.

Run ./generate_certificates.sh

NOTE: In production the cloud provider would set these on your behalf enabling HTTPS

Start

Run python3 app.py to start project.

The https://API_URL:PORT/predict should be used for the POST API calls

Following an example of the API body request

{
    "model_type": "rice_leaf",
    "content_url": "https://techwarriors-objectstorage-test.s3.us-south.cloud-object-storage.appdomain.cloud/brownspotDSC_0100.jpg"
}

Tests

Run the directory tests, if in PyCharm .it will execute all files with application running. Running in CLI, run the pytestcommand on the project directory.

NOTE: Ensure to set the PYTHONPATH first to make pytest localize the app. In Linux OS try: export PYTHONPATH=.

Roadmap:

  • Unit tests;
  • Create a REST API to use this code;
  • Kaggle explains;
  • Tests describe how to execute;
  • Deploy project in VPS;
  • Validation URL from back-end with prefix in DNS of cloud (Jorge);
  • ChatGPT return with data structured;
  • Create all tests with different models;
  • Search new tomato models in Kaggle;
  • Integrated responses with ChatGPT;
  • Upload vegetable images in cloud (Jorge);
  • Configure CORS.

About

The AI project to assess the health of vegetables for HarvTech.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published