Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CropGuard

GitHub last commit GitHub issues GitHub stars Repo size Python Flask TensorFlow

CropGuard is a Flask-based crop disease detection and advisory platform. It combines computer vision and machine learning to analyze plant images and provides insights like severity, recommendations, and optional integrations (weather, pest alerts, voice).

Features

  • Image upload and disease classification using TensorFlow/Keras and OpenCV
  • Severity analysis and recommendation modules
  • Optional integrations: weather insights, pest alerts, voice interface, Gemini validation
  • Admin and auth flows for managing access
  • Health check endpoint at /health

Tech Stack

  • Python, Flask, SQLAlchemy
  • TensorFlow/Keras, OpenCV, Pillow
  • SQLite (dev) or MySQL (prod)
  • Requests/HTTPX for external services

Getting Started

1) Setup

python -m venv .venv
. .venv/Scripts/activate
pip install -r requirements.txt

2) Environment variables

Create a .env file in the project root (optional for development):

FLASK_ENV=development
FLASK_DEBUG=1
FLASK_SECRET_KEY=change-me
ALLOWED_ORIGINS=http://localhost:5000

# Optional services
GEMINI_API_KEY=
WEATHER_API_KEY=

# Optional database override
# DATABASE_URL=sqlite:///instance/crop_disease_web.db

3) Model files

Model artifacts are excluded from Git. Place your model in models/ or set MODEL_PATH to a custom location. The app looks for common filenames like best_phase2.keras or plant_disease_model.keras.

4) Run the app

python src/api/app.py

Open http://127.0.0.1:5000 in your browser.

Tests

pytest

Project Structure

config.py
requirements.txt
models/
    class_mapping.json
src/
    api/
    ml/
    modules/
static/
templates/

Notes

  • Production requires FLASK_SECRET_KEY and a MySQL database configuration (DATABASE_URL or DB_*).
  • Optional integrations are enabled only if their API keys are set.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages