CoolFace
Apppublic

Shubham9008/leaf_detection_eith_gatekeeper

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes
App README

πŸ₯” Potato Disease Detection System (Gatekeeper-Based)

A deep learning–based web application for detecting potato leaf diseases using a gatekeeper-first architecture. The system is built with FastAPI, TensorFlow, and custom HTML/CSS/JS.

πŸ’‘ System Pipeline (Two-Stage Pipeline)

To prevent false classifications from irrelevant images (such as background, soil, or hands), the system validates images before performing diagnosis:

  1. 1.πŸ›‘οΈ The Gatekeeper (Validation Stage)
  2. 2.Task: Binary Classification (Leaf vs. Non-Leaf).
  3. 3.Role: Evaluates the image and filters out any non-leaf objects.
  4. 4.Accuracy: ~79% (MobileNetV2 backbone).
  1. 1.πŸ”¬ The Classifier (Diagnostic Stage)
  2. 2.Task: Multi-class Classification.
  3. 3.Classes: Healthy, Early Blight, Late Blight.
  4. 4.Accuracy: ~85% (Sequential CNN model).

πŸ“ Repository Structure

  • β€”api/app.py - FastAPI backend containing validation & prediction pipelines.
  • β€”templates/index.html - Main application frontend.
  • β€”static/ - Custom CSS styling and Javascript frontend logic.
  • β€”Dockerfile - Docker configuration file for Hugging Face Spaces deployment.

πŸš€ How to Run Locally

1. Synchronize Dependencies

bash
uv sync

2. Run the Application

bash
uv run python main.py

Open http://127.0.0.1:8000 in your web browser.


🌐 How to Deploy to Hugging Face Spaces

  1. 1.Create a new Space on Hugging Face.
  2. 2.Select Docker as the SDK (select the Blank template).
  3. 3.Push your repository's deployment branch to the Hugging Face space repository. Hugging Face will read the Dockerfile and launch the web server automatically.