Shubham9008/leaf_detection_eith_gatekeeper
0
1---2title: Potato Disease Detection Gatekeeper3emoji: 🥔4colorFrom: green5colorTo: blue6sdk: docker7pinned: false8license: mit9short_description: Potato Disease Detection System (Gatekeeper-Based)10---11 12# 🥔 Potato Disease Detection System (Gatekeeper-Based)13 14A 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.15 16## 💡 System Pipeline (Two-Stage Pipeline)17 18To prevent false classifications from irrelevant images (such as background, soil, or hands), the system validates images before performing diagnosis:19 201. **🛡️ The Gatekeeper (Validation Stage)**21 * **Task**: Binary Classification (Leaf vs. Non-Leaf).22 * **Role**: Evaluates the image and filters out any non-leaf objects.23 * **Accuracy**: ~79% (MobileNetV2 backbone).24 252. **🔬 The Classifier (Diagnostic Stage)**26 * **Task**: Multi-class Classification.27 * **Classes**: `Healthy`, `Early Blight`, `Late Blight`.28 * **Accuracy**: ~85% (Sequential CNN model).29 30---31 32## 📁 Repository Structure33 34* [api/app.py](file:///e:/new_repo/leaf-gatekeeper-based-potato-disease-detection/api/app.py) - FastAPI backend containing validation & prediction pipelines.35* [templates/index.html](file:///e:/new_repo/leaf-gatekeeper-based-potato-disease-detection/templates/index.html) - Main application frontend.36* [static/](file:///e:/new_repo/leaf-gatekeeper-based-potato-disease-detection/static) - Custom CSS styling and Javascript frontend logic.37* [Dockerfile](file:///e:/new_repo/leaf-gatekeeper-based-potato-disease-detection/Dockerfile) - Docker configuration file for Hugging Face Spaces deployment.38 39---40 41## 🚀 How to Run Locally42 43### 1. Synchronize Dependencies44```bash45uv sync46```47 48### 2. Run the Application49```bash50uv run python main.py51```52Open `http://127.0.0.1:8000` in your web browser.53 54---55 56## 🌐 How to Deploy to Hugging Face Spaces57 581. Create a new Space on Hugging Face.592. Select **Docker** as the SDK (select the **Blank** template).603. Push your repository's deployment branch to the Hugging Face space repository. Hugging Face will read the Dockerfile and launch the web server automatically.61 