This project detects underwater plastic pollution using a trained YOLO model. It allows users to upload images or videos and processes them to identify plastic waste in aquatic environments.
- Upload images or videos for real-time detection.
- Uses a YOLO model for accurate object detection.
- Displays processed images and videos with bounding boxes.
- Responsive web interface built with Flask.
Ensure you have the following installed:
- Python 3.8+
- Conda (Optional but recommended)
-
Clone the repository:
git clone https://github.com/yourusername/UnderwaterPlasticDetection.git cd UnderwaterPlasticDetection -
Create a virtual environment (optional but recommended):
conda create --name underwater_detection python=3.8 -y conda activate underwater_detection
or using
venv:python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Ensure the YOLO model is placed correctly inside the project directory:
├── static/ ├── templates/ ├── uploads/ # Stores uploaded test images/videos ├── models/ ├── best.pt # Your trained YOLO model ├── app.py # Flask backend ├── requirements.txt ├── README.md -
Run the Flask application:
python app.py
-
Open your browser and visit:
http://127.0.0.1:5000/
- Click Upload Image or Upload Video.
- The processed output will be displayed on the right.
- Click Download to save the processed image/video.
The project requires the following packages:
Flask
opencv-python
numpy
ultralytics # For YOLO
You can install them using:
pip install -r requirements.txtUnderwaterPlasticDetection/
├── static/
│ ├── css/
│ │ ├── styles.css
├── templates/
│ ├── index.html
├── uploads/ # Stores uploaded test images/videos
├── models/
│ ├── best.pt # Your trained YOLO model
├── app.py # Flask backend
├── requirements.txt
├── README.md
Pull requests are welcome. For major changes, please open an issue first to discuss the proposed changes.