Welcome to the Fruit Ripeness and Disease Detection System! This application utilizes advanced YOLO (You Only Look Once) models to detect various fruits and diagnose diseases in bananas, mangoes, and pomegranates. Built with Flask, the web application allows users to either upload images for analysis or use a live video feed for real-time detection and diagnosis.
The models were trained using specialized datasets, which can be accessed here:
- Fruit Detection Dataset
- Banana Disease Detection Dataset
- Mango Disease Detection Dataset
- Pomegranate Disease Detection Dataset
The project is organized as follows:
Fruit-and-Disease-Detection/
│
├── templates/
│ ├── index.html
│ ├── fruit_detection.html
│ ├── disease_detection.html
│ ├── banana_detection.html
│ ├── mango_detection.html
│ ├── pomogranate_detection.html
│ ├── uploaded_image.html
│
├── static/
│ ├── css/
│ ├── js/
│ ├── images/
│
├── app.py
├── requirements.txt
└── README.md
To set up the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/AshishTukaral/Fruit-Ripeness-and-Disease-Detection.git
cd fruit-and-disease-detection
- Install the required dependencies:
pip install -r requirements.txt
Start the Flask application by running:
python app.py
Access the application in your browser at http://0.0.0.0:5000
.
The main landing page, accessible at /
, provides links to various functionalities of the application.
- Page:
/fruit_detection
- Live Video Feed:
/video_feed
- Image Detection Endpoint:
/detect_objects
This feature allows users to use a live video feed for real-time fruit detection or upload images for analysis.
- Main Page:
/disease_detection
- Banana Disease Detection:
/banana_detection
- Mango Disease Detection:
/mango_detection
- Pomegranate Disease Detection:
/pomogranate_detection
Users can upload images of specific fruits to detect diseases. Each fruit type has its dedicated YOLO model.
- Endpoint:
/uploads/<filename>
This endpoint displays the uploaded images along with the detection results.
The application utilizes several YOLO models for different detection tasks:
- Fruit Detection Model:
weights_3/best.pt
- Banana Disease Detection Model:
train2/weights/best.pt
- Mango Disease Detection Model:
train/weights/best.pt
- Pomegranate Disease Detection Model:
train4/weights/best.pt
The application provides several API endpoints:
- Home:
GET /
- Fruit Detection:
GET /fruit_detection
- Video Feed:
GET /video_feed
- Detect Objects:
POST /detect_objects
- Disease Detection:
GET /disease_detection
- Banana Detection:
GET, POST /banana_detection
- Mango Detection:
GET, POST /mango_detection
- Pomegranate Detection:
GET, POST /pomogranate_detection
- Uploaded Image:
GET /uploads/<filename>
Here are some example outputs generated by the system:
We welcome contributions! Feel free to fork the repository, make your changes, and submit a pull request. For issues or feature requests, open an issue on the repository.