CoolFace
Apppublic

isamadafridi/obstacle_detection

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

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

ParameterValue
ModelYOLOv8n
Epochs50
Image Size512 ร— 512
Batch Size8
OptimizerMuSGD
FrameworkPyTorch
GPUTesla T4

๐Ÿ”ฅ 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

MetricScore
mAP500.902
mAP50-950.728
Precision0.884
Recall0.834

โœจ 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

bash
project/
โ”‚
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ best.pt
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ“ฆ Installation

Clone Huggingface Repository

bash
git clone https://huggingface.co/spaces/isamadafridi/obstacle_detection
cd your-repository-name

Github Repository

๐Ÿ”—.Github Repo


๐Ÿ“ฅ Install Dependencies

bash
pip install -r requirements.txt

โ–ถ๏ธ Run Application

bash
python app.py

๐Ÿงช Sample Inference

python
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