Update README.md
Browse files
README.md
CHANGED
@@ -1,90 +1,99 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
-
|
18 |
-
-
|
19 |
-
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
```
|
34 |
-
|
35 |
-
|
36 |
-
```
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
```
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
title: Helmet_Detection_OCR_ANPR
|
4 |
+
sdk: gradio
|
5 |
+
emoji: 📚
|
6 |
+
colorFrom: red
|
7 |
+
colorTo: yellow
|
8 |
+
short_description: Helmet_Detection_OCR_ANPR
|
9 |
+
---
|
10 |
+
# Combined ANPR and Helmet Detection System
|
11 |
+
|
12 |
+
A comprehensive traffic violation detection system that combines Automatic Number Plate Recognition (ANPR) and Helmet Detection using YOLOv8.
|
13 |
+
|
14 |
+
## Features
|
15 |
+
|
16 |
+
- Real-time license plate detection and recognition
|
17 |
+
- Helmet detection for two-wheeler riders
|
18 |
+
- Modern Gradio interface with real-time processing
|
19 |
+
- Adjustable confidence threshold for detection
|
20 |
+
- Combined visual annotations from both models
|
21 |
+
- Queue support for multiple users
|
22 |
+
- Comprehensive error handling
|
23 |
+
|
24 |
+
## Prerequisites
|
25 |
+
|
26 |
+
- Python 3.8 or higher
|
27 |
+
- CUDA-capable GPU (recommended for better performance)
|
28 |
+
- 8GB RAM minimum
|
29 |
+
|
30 |
+
## Installation
|
31 |
+
|
32 |
+
1. Clone the repository:
|
33 |
+
```bash
|
34 |
+
git clone <repository-url>
|
35 |
+
cd <repository-name>
|
36 |
+
```
|
37 |
+
|
38 |
+
2. Create and activate a virtual environment:
|
39 |
+
```bash
|
40 |
+
python -m venv venv
|
41 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
42 |
+
```
|
43 |
+
|
44 |
+
3. Install dependencies:
|
45 |
+
```bash
|
46 |
+
pip install -r requirements.txt
|
47 |
+
```
|
48 |
+
|
49 |
+
## Usage
|
50 |
+
|
51 |
+
1. Start the application:
|
52 |
+
```bash
|
53 |
+
python app.py
|
54 |
+
```
|
55 |
+
|
56 |
+
2. Open your web browser and navigate to:
|
57 |
+
```
|
58 |
+
http://localhost:7860
|
59 |
+
```
|
60 |
+
|
61 |
+
3. Upload an image or use the example images to test the system.
|
62 |
+
|
63 |
+
## Model Files
|
64 |
+
|
65 |
+
The following model files are required:
|
66 |
+
- `ANPR_IND/licence_plat.pt`: License plate detection model
|
67 |
+
- `ANPR_IND/licence_character.pt`: Character recognition model
|
68 |
+
- `Helmet-Detect-model/best.pt`: Helmet detection model
|
69 |
+
|
70 |
+
## API Endpoints
|
71 |
+
|
72 |
+
The application exposes the following endpoints:
|
73 |
+
- `/api/predict`: POST endpoint for image processing
|
74 |
+
- `/api/health`: GET endpoint for health check
|
75 |
+
|
76 |
+
## Deployment
|
77 |
+
|
78 |
+
### Local Deployment
|
79 |
+
```bash
|
80 |
+
python app.py
|
81 |
+
```
|
82 |
+
|
83 |
+
### Docker Deployment
|
84 |
+
```bash
|
85 |
+
docker build -t traffic-detection .
|
86 |
+
docker run -p 7860:7860 traffic-detection
|
87 |
+
```
|
88 |
+
|
89 |
+
## Contributing
|
90 |
+
|
91 |
+
1. Fork the repository
|
92 |
+
2. Create your feature branch
|
93 |
+
3. Commit your changes
|
94 |
+
4. Push to the branch
|
95 |
+
5. Create a new Pull Request
|
96 |
+
|
97 |
+
## License
|
98 |
+
|
99 |
+
This project is licensed under the MIT License - see the LICENSE file for details.
|