isamadafridi/obstacle_detection
YOLOv8 Obstacle Detection System
A real-time obstacle detection system built using YOLOv8 and trained on a custom obstacle detection dataset. This project detects multiple real-world objects such as vehicles, pedestrians, road obstacles, traffic signs, poles, stairs, dustbins, and more.
The system is deployed on Hugging Face Spaces using Gradio for interactive inference.
๐ Live Demo
๐ Hugging Face Demo
๐ Dataset
Dataset used for training:
๐ Obstacle Detection Dataset (Kaggle)
Dataset Statistics
- 25 object classes
- Real-world outdoor obstacle images
- Annotated bounding boxes
- YOLO format annotations
- Suitable for autonomous navigation systems
๐ง Model Architecture
This project uses YOLOv8 for object detection.
Model Variant
- YOLOv8n (Nano version)
Why YOLOv8n?
YOLOv8n was selected because it provides:
- Fast inference speed
- Lightweight architecture
- Low memory usage
- Real-time detection capability
- Easy deployment
โ๏ธ Training Configuration
๐ฅ Data Augmentation
The model was trained using YOLOv8 built-in augmentations:
- Mosaic augmentation
- Horizontal flip
- HSV color augmentation
- Translation augmentation
- Scaling augmentation
- Blur augmentation
- CLAHE enhancement
These augmentations improve model robustness and generalization.
๐ Model Performance
โจ Features
- Real-time obstacle detection
- Multi-class object detection
- Interactive web interface
- YOLOv8 inference
- Upload and analyze images
- Lightweight deployment
- Hugging Face Spaces integration
๐ Tech Stack
Frontend
- Gradio
Backend
- Python 3.13
Deep Learning
- PyTorch
- Ultralytics YOLOv8
Deployment
- Hugging Face Spaces
๐ Project Structure
project/
โ
โโโ app.py
โโโ best.pt
โโโ requirements.txt
โโโ README.md๐ฆ Installation
Clone Huggingface Repository
git clone https://huggingface.co/spaces/isamadafridi/obstacle_detection
cd your-repository-nameGithub Repository
๐.Github Repo
๐ฅ Install Dependencies
pip install -r requirements.txtโถ๏ธ Run Application
python app.py๐งช Sample Inference
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.predict(
source="image.jpg",
conf=0.25,
save=True
)๐ Deployment
This project is deployed on Hugging Face Spaces.
๐ Live Application
๐ Future Improvements
- Video stream detection
- Webcam integration
- TensorRT optimization
- Mobile deployment
- Edge AI optimization
- Real-time surveillance system
๐จโ๐ป Developer
Abdul Samad Afridi
๐ง Email: isamadafridi@gmail.com
๐ License
This project is intended for educational and research purposes.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
