Vision-AN18 banner

Vision-AN18 โ€” Faster R-CNN

Privacy-preserving computer vision for detecting and anonymizing sensitive visual information in street images.

Vision-AN18 detects license plates and house numbers in street-level images (Google Street View style), then blurs the detected regions to preserve privacy while keeping the rest of the image useful.

Examples

Original image on the left, output of the anonymization pipeline on the right (Gaussian blur applied to each detected box).

Original Anonymized
Plate original Plate anonymized
House and plate original House and plate anonymized
Street original Street anonymized

Raw detection

License plate detection example

โš ๏ธ Known limitations โ€” license plate detection is reliable. House number detection is still imperfect (scale bias inherited from the SVHN dataset used for this class), and the model can produce false positives on large flat regions such as windows or walls (see the third example).

Model

Architecture Faster R-CNN
Backbone ResNet-50 + FPN
Framework PyTorch / torchvision
Classes 0: background, 1: license_plate, 2: house_number
Input size min 800 / max 1333 px (resized internally)
Training data OpenLPR (plates) + SVHN (house numbers)
Training hardware NVIDIA RTX 5050

Usage

import torch
from PIL import Image
import torchvision.transforms.functional as TF
from huggingface_hub import snapshot_download
import sys

repo_dir = snapshot_download("ApyHTML19/Faster-RCNN-Vision-ANN18")
sys.path.insert(0, repo_dir)
from models.faster_rcnn import create_model

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

model = create_model(num_classes=3, pretrained_backbone=False)
checkpoint = torch.load(f"{repo_dir}/best_model.pth", map_location=device)
model.load_state_dict(checkpoint.get("model_state_dict", checkpoint))
model.to(device).eval()

CLASS_NAMES = {1: "license_plate", 2: "house_number"}

image = Image.open(f"{repo_dir}/examples/inputs/plate.jpg").convert("RGB")
with torch.inference_mode():
    output = model([TF.to_tensor(image).to(device)])[0]

for box, label, score in zip(output["boxes"], output["labels"], output["scores"]):
    if score >= 0.5:
        print(CLASS_NAMES[int(label)], f"{score:.3f}", [round(v) for v in box.tolist()])

Blurring the detections

import cv2

img = cv2.imread(f"{repo_dir}/examples/inputs/plate.jpg")
for box, score in zip(output["boxes"], output["scores"]):
    if score < 0.5:
        continue
    x1, y1, x2, y2 = map(int, box.tolist())
    img[y1:y2, x1:x2] = cv2.GaussianBlur(img[y1:y2, x1:x2], (51, 51), 0)
cv2.imwrite("anonymized.jpg", img)

Intended use

Research and privacy-oriented computer vision experiments: anonymizing license plates and house numbers in street-level imagery before storage or publication. Not intended for surveillance or for identifying individuals.

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