Absolutely, Yasir! Here's an enhanced, professional, and detailed Hugging Face model card README for your Number Plate Detection & Recognition model, incorporating all key info you provided β€” polished and ready to publish on the Hugging Face Hub:


---
library_name: transformers
tags:
  - number plate detection
  - object detection
  - OCR
  - fine-tuned
  - vision-language
license: mit
---

# Number Plate Detection & Recognition Model (Florence-2 Fine-Tuned)

## Model Overview

This model is a fine-tuned version of **Microsoft's Florence-2 Large** (`florence-2-large-nsfw-pretrain`) adapted for **automatic number plate detection and recognition**. It processes vehicle images to localize number plates with bounding boxes and applies OCR to extract the license plate text, enabling high-accuracy license plate reading.

The model leverages transformer-based vision-language architectures and is trained on a custom dataset of vehicle images with annotated license plates.

---

## Uses

### Intended Use Cases

- Real-time **traffic monitoring and control systems**  
- Automated **toll collection** and parking management  
- **Law enforcement** for vehicle identification  
- Smart city infrastructure and **vehicle tracking** solutions

### Potential Downstream Applications

- Region-specific fine-tuning to handle various license plate formats worldwide  
- Integration with object detection pipelines for multi-object recognition tasks  
- Use in embedded devices with GPU acceleration for rapid inference  

### Limitations & Out-of-Scope Uses

- Not optimized for **general object detection** beyond license plates  
- Performance may degrade with **poor lighting, motion blur, or occluded plates**  
- Does not reliably recognize **handwritten or decorative/customized plates**  
- Model accuracy is affected by the quality and diversity of training data  

---

## Dataset Information

- **Dataset source:** Custom-labeled dataset with 6,176 training, 1,765 validation, and 882 test images  
- **Annotations:** Each sample includes image metadata, bounding boxes for license plates, and OCR-extracted text labels  
- **Data diversity:** Various lighting conditions, vehicle angles, and plate styles  
- **Preprocessing:** Images resized and normalized to match Florence-2 input requirements; bounding boxes used to isolate plate regions  

---

## Training Details

- **Base model:** `florence-2-large-nsfw-pretrain`  
- **Fine-tuning:** Combined bounding box detection with OCR text extraction  
- **Hyperparameters:**  
  - Epochs: 10 (configurable)  
  - Optimizer: AdamW  
  - Loss: Cross-entropy  
  - Batch size & learning rate: Adjusted per hardware capability  
- **Hardware:** GPU-accelerated training (specify GPU model)  
- **Training duration:** [Insert total time]  
- **Model size:** [Insert size in MB]  

---

## Evaluation

### Evaluation Notes

- High accuracy on clear, high-quality images  
- Performance declines on low-resolution, occluded, or angled plates  
- Future work: augment dataset for robustness and support non-standard plates  

---

## Usage

Load and run inference with the model as follows:

```python
from transformers import AutoProcessor, AutoModelForObjectDetection
from PIL import Image
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

model_name = "your-hf-username/number-plate-florence2"
processor = AutoProcessor.from_pretrained(model_name)
model = AutoModelForObjectDetection.from_pretrained(model_name).to(device)

def detect_number_plate(image_path):
    image = Image.open(image_path).convert("RGB")
    inputs = processor(images=image, return_tensors="pt").to(device)
    outputs = model(**inputs)
    # Process outputs (bounding boxes, scores, OCR text) as needed
    return outputs

result = detect_number_plate("path/to/car_image.jpg")
print(result)

Model Limitations and Bias

  • Model may favor license plate styles prevalent in the training dataset
  • Not guaranteed to perform equally across all geographic regions
  • Sensitive to image quality and environmental factors
  • Bias can be mitigated by expanding training datasets and applying data augmentation

Environmental Impact

  • Training performed on [GPU model] over [total training hours]
  • Estimated carbon footprint: [Insert estimate if available]
  • Recommendations for future improvements include model pruning and mixed-precision training

Citation

If you use this model, please cite:

@article{your_paper_2025,
  title={Fine-tuning Florence-2 for License Plate Detection and Recognition},
  author={Muhammad Yasir},
  year={2024}
}

Authors & Contact

Muhammad Yasir AI/ML Engineer | Web & Security Developer πŸ“§ [email protected] 🌐 Portfolio πŸ€– Hugging Face πŸ’» GitHub


For further questions, please open an issue or contact the author directly.


Downloads last month
23
Safetensors
Model size
271M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for devxyasir/florence-finetuned-license-plate-detection

Finetuned
(19)
this model

Dataset used to train devxyasir/florence-finetuned-license-plate-detection