RF-DETR Traffic Enforcement Detector

An object detection model trained for privacy-blurring of Dutch traffic enforcement (speed camera) photos. The model detects three classes: persons, vehicles, and license plates.

Classes

ID Class Description
0 person Pedestrians, drivers, cyclists
1 vehicle Cars, buses, trucks, motorcycles
2 license_plate License plates (NL + EU formats)

Model Architecture

  • Base: RF-DETR (Roboflow, Apache 2.0)
  • Backbone: DINOv2 Vision Transformer
  • Variant: RFDETRBase
  • Training resolution: 560×560

Training Data

The model was trained on a combination of four datasets:

1. COCO 2017 (CC BY 4.0)

  • Source: cocodataset.org
  • Usage: Person and vehicle annotations (classes 1, 3, 4, 6, 8)
  • Volume: ~8,000 training images selected

2. keremberke/license-plate-object-detection (CC BY 4.0)

  • Source: HuggingFace
  • Original: Augmented Startups via Roboflow Universe
  • Usage: License plate bounding box detection
  • Volume: 6,176 training images

3. 0xnu/european-licence-plate (Apache 2.0)

  • Source: HuggingFace
  • Author: Finbarrs Oketunji
  • Usage: European (including Dutch) license plates
  • Volume: Selected subset

4. Rickkosse/coco-license-plate-pseudo-labels (CC BY 4.0)

  • Source: HuggingFace
  • Usage: Pseudo-labeled license plates on COCO images, generated using a YOLOv9 plate detector applied per vehicle ROI
  • Volume: ~333 images with 426 plate annotations

Data Augmentation

License plate annotations were oversampled 4× with grayscale ROI augmentation applied to each copy, simulating IR/night flash camera conditions.

Training Details

Parameter Value
Epochs 50
Effective batch size 32
Learning rate 0.0001
Optimizer AdamW (RF-DETR default)
Hardware NVIDIA A100 (Google Colab)
Training date 2026-04-12

Performance

Metric Score
mAP@0.5 see evaluation results

Usage

Installation

pip install rfdetr huggingface_hub

Inference (PyTorch)

from rfdetr import RFDETRBase
from huggingface_hub import hf_hub_download
from PIL import Image

# Download model
weights_path = hf_hub_download(
    repo_id="Rickkosse/rfdetr-flitsfoto-detector",
    filename="checkpoint_best_total.pth"
)

# Load model
model = RFDETRBase(pretrain_weights=weights_path)
model.optimize_for_inference()  # optional: ~2x faster

# Run inference
image = Image.open("photo.jpg").convert("RGB")
detections = model.predict(image, threshold=0.3)

# Classes: 0=person, 1=vehicle, 2=license_plate
for xyxy, cls, conf in zip(detections.xyxy, detections.class_id, detections.confidence):
    x1, y1, x2, y2 = map(int, xyxy)
    label = ["person", "vehicle", "license_plate"][int(cls)]
    print(f"{label}: {conf:.2f} @ [{x1}, {y1}, {x2}, {y2}]")

Inference (ONNX Runtime)

import onnxruntime as ort
import numpy as np
from PIL import Image
from huggingface_hub import hf_hub_download

onnx_path = hf_hub_download(
    repo_id="Rickkosse/rfdetr-flitsfoto-detector",
    filename="inference_model.onnx"
)

session = ort.InferenceSession(
    onnx_path,
    providers=["CUDAExecutionProvider", "CPUExecutionProvider"]
)

mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
std  = np.array([0.229, 0.224, 0.225], dtype=np.float32)

image  = Image.open("photo.jpg").convert("RGB").resize((560, 560))
img_np = (np.array(image, dtype=np.float32) / 255.0 - mean) / std
img_np = np.transpose(img_np, (2, 0, 1))[None]  # NCHW

boxes, labels = session.run(None, {"input": img_np})

Usage with blur_privacy.py

from rfdetr import RFDETRBase
from huggingface_hub import hf_hub_download

weights = hf_hub_download("Rickkosse/rfdetr-flitsfoto-detector", "checkpoint_best_total.pth")
model   = RFDETRBase(pretrain_weights=weights)

# Replace RFDETRBase() initialisation in PrivacyBlurPipeline.__init__

License

This model is released under the Apache 2.0 License. Free to use for both commercial and non-commercial purposes. See LICENSE for details.

Citation

If you use this model in research or products, please cite:

@misc{flitsfoto-detector-2026,
  title     = {RF-DETR Traffic Enforcement Detector},
  author    = {Rickkosse},
  year      = {2026},
  publisher = {HuggingFace},
  url       = {https://huggingface.co/Rickkosse/rfdetr-flitsfoto-detector}
}

And the underlying datasets:

@misc{vehicle-registration-plates-trudk,
  title  = {Vehicle Registration Plates Dataset},
  author = {Augmented Startups},
  year   = {2022},
  url    = {https://universe.roboflow.com/augmented-startups/vehicle-registration-plates-trudk}
}

@misc{eulpr2025,
  title     = {EULPR: European License Plate Recognition},
  author    = {Finbarrs Oketunji},
  year      = {2025},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/datasets/0xnu/european-licence-plate}
}

@misc{coco-license-plate-pseudo-labels,
  title     = {COCO License Plate Pseudo-Labels},
  author    = {Rickkosse},
  year      = {2026},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/datasets/Rickkosse/coco-license-plate-pseudo-labels}
}

@misc{rf-detr,
  title  = {RF-DETR: Neural Architecture Search for Real-Time Detection Transformers},
  author = {Isaac Robinson and Peter Robicheaux and Matvei Popov and Deva Ramanan and Neehar Peri},
  year   = {2025},
  url    = {https://arxiv.org/abs/2511.09554}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train Rickkosse/rfdetr-flitsfoto-detector

Paper for Rickkosse/rfdetr-flitsfoto-detector

Evaluation results

  • mAP@0.5 on Custom traffic enforcement testset
    self-reported
    see evaluation results