Abs6187's picture
Update README.md
1a2f286 verified

A newer version of the Gradio SDK is available: 5.49.1

Upgrade
metadata
license: mit
title: Helmet_Detection_OCR_ANPR
sdk: gradio
emoji: πŸ“š
colorFrom: red
colorTo: yellow
short_description: Helmet_Detection_OCR_ANPR

Combined ANPR and Helmet Detection System

A comprehensive traffic violation detection system that combines Automatic Number Plate Recognition (ANPR) and Helmet Detection using YOLOv8.

Features

  • Real-time license plate detection and recognition
  • Helmet detection for two-wheeler riders
  • Modern Gradio interface with real-time processing
  • Adjustable confidence threshold for detection
  • Combined visual annotations from both models
  • Queue support for multiple users
  • Comprehensive error handling

Prerequisites

  • Python 3.8 or higher
  • CUDA-capable GPU (recommended for better performance)
  • 8GB RAM minimum

Installation

  1. Clone the repository:
git clone <repository-url>
cd <repository-name>
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

  1. Start the application:
python app.py
  1. Open your web browser and navigate to:
http://localhost:7860
  1. Upload an image or use the example images to test the system.

Model Files

The following model files are required:

  • ANPR_IND/licence_plat.pt: License plate detection model
  • ANPR_IND/licence_character.pt: Character recognition model
  • Helmet-Detect-model/best.pt: Helmet detection model

API Endpoints

The application exposes the following endpoints:

  • /api/predict: POST endpoint for image processing
  • /api/health: GET endpoint for health check

Deployment

Local Deployment

python app.py

Docker Deployment

docker build -t traffic-detection .
docker run -p 7860:7860 traffic-detection

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.