Litter Detection Model (YOLOv8)
This model detects plastic litter (bags and bottles) in images using YOLOv8.
Model Description
- Base Model: yolov8n.pt
- Task: Object Detection
- Classes: Litter
- Framework: PyTorch + Ultralytics YOLO
Training Details
| Parameter | Value |
|---|---|
| Epochs | 8 |
| Batch Size | 16 |
| Image Size | 640px |
| Optimizer | AdamW |
| Learning Rate | 0.001 |
Usage
Install Dependencies
pip install ultralytics huggingface_hub
Download and Use Model
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
# Download model
model_path = hf_hub_download(
repo_id="esapzoi/litter-detection-yolov8",
filename="best.pt"
)
# Load model
model = YOLO(model_path)
# Run inference
results = model.predict("path/to/image.jpg", conf=0.25)
# Process results
for result in results:
boxes = result.boxes
for box in boxes:
class_id = int(box.cls[0])
confidence = float(box.conf[0])
class_name = model.names[class_id]
print(f"Detected: {class_name} ({confidence:.2%})")
Batch Processing
# Process multiple images
results = model.predict(["img1.jpg", "img2.jpg", "img3.jpg"])
# Save annotated images
for i, result in enumerate(results):
result.save(filename=f"result_{i}.jpg")
Classes
| ID | Class Name |
|---|---|
| 0 | Litter |
Performance
Use this model for litter detection systems, environmental monitoring, and waste management applications.
Citation
If you use this model, please cite:
@misc{litter_detection_yolov8,
author = {Your Name},
title = {Litter Detection with YOLOv8},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/esapzoi/litter-detection-yolov8}
}
License
MIT License
Training Data
Model trained on plastic litter detection dataset focusing on bags and bottles.
- Downloads last month
- 21