|
--- |
|
license: apache-2.0 |
|
datasets: |
|
- keremberke/license-plate-object-detection |
|
language: |
|
- en |
|
metrics: |
|
- accuracy |
|
base_model: |
|
- Ultralytics/YOLOv8 |
|
pipeline_tag: object-detection |
|
tags: |
|
- yolov8 |
|
- fine-tuned |
|
- self-driving |
|
new_version: yasirfaizahmed/license-plate-object-detection |
|
library_name: ultralytics |
|
--- |
|
|
|
|
|
--- |
|
|
|
|
|
# YOLOv8 License Plate Detection |
|
This project uses the **YOLOv8** object detection model to detect license plates. The dataset used is **Keremberke's License Plate Object Detection** , and the model is trained using the **Ultralytics YOLOv8 framework** . |
|
## Installation |
|
|
|
Ensure you have the required dependencies installed: |
|
|
|
|
|
```bash |
|
pip install datasets ultralytics opencv-python numpy pandas matplotlib |
|
``` |
|
|
|
## Dataset |
|
The dataset is loaded from Hugging Face's `datasets` library: |
|
|
|
```python |
|
from datasets import load_dataset |
|
ds = load_dataset("keremberke/license-plate-object-detection", "full") |
|
``` |
|
|
|
The dataset is split into: |
|
|
|
- **Training Set** |
|
|
|
- **Validation Set** |
|
|
|
- **Test Set** |
|
|
|
## Data Preprocessing |
|
|
|
- Images are extracted from the dataset and saved locally. |
|
|
|
- Bounding box annotations are converted into **YOLO format** (normalized coordinates). |
|
|
|
- The dataset is structured into: |
|
|
|
```kotlin |
|
dataset/ |
|
βββ images/ |
|
β βββ train/ |
|
β βββ val/ |
|
βββ labels/ |
|
β βββ train/ |
|
β βββ val/ |
|
``` |
|
|
|
## Model Training |
|
A pre-trained **YOLOv8** model (`yolov8n.pt`) is fine-tuned on the dataset: |
|
|
|
```python |
|
from ultralytics import YOLO |
|
|
|
model = YOLO('yolov8n.pt') # Load a small YOLOv8 model |
|
results = model.train(data="dataset.yaml", epochs=75, imgsz=640, batch=16) |
|
``` |
|
|
|
## Training Configuration |
|
|
|
- **Epochs** : 75 |
|
|
|
- **Image Size** : 640x640 |
|
|
|
- **Batch Size** : 16 |
|
|
|
|
|
|
|
--- |
|
|