/ Модель

Характеристики

Лицензия
CC BY-NC 4.0
Архитектура
d-fine · dense
Библиотека
pytorch
Опубликована
23 сен 2026

UrbanAnonymizer

Поиск объектовИзображение → bounding_boxes3 профессии

UrbanAnonymizer обнаруживает лица и автомобильные номера на уличных изображениях и видео, чтобы автоматически закрывать их масками.

60скачиваний за 30 дней5лайковвеса обновлены29 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

UrbanAnonymizer — модель Мехмета Керема Туркджана из Columbia University для автоматического сокрытия лиц и автомобильных номерных знаков на уличных изображениях и видео. Она обнаруживает оба типа объектов одним детектором D-FINE-X на базе HGNetv2-B5. Модель обучена на 119 тысячах изображений из пяти открытых наборов данных; для неё доступны веса PyTorch и экспорт ONNX, а также путь сборки для TensorRT 11.

Для видео README описывает отдельный офлайн-трекер, который связывает детекции вперёд и назад во времени и заполняет короткие пропуски обнаружения, чтобы маска сохранялась между кадрами. Внешние тесты показывают высокую точность обнаружения на UFDD и PP4AV; на A100 заявлена скорость 39 кадров в секунду для видео 1080p. Модель предназначена для анонимизации уличных материалов, однако пропуски объектов и чрезмерное покрытие масками остаются возможными, а тестовые данные частично связаны по источникам с обучающими. Лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но некоммерческое.

Сценарии применения

  • анонимизация лиц на фотографиях улиц
  • скрытие автомобильных номеров на изображениях
  • маскирование лиц и номеров в видеозаписях
  • заполнение пропусков маски между кадрами видео

Ограничения

Детектор может пропускать лица и номера, а рекомендованные пороги влияют на долю изображения, закрытую масками. TensorRT-движки зависят от архитектуры GPU и версии TensorRT; лицензия CC BY-NC 4.0 ограничивает использование некоммерческими условиями.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

UrbanAnonymizer detects faces and license plates in street-level imagery and masks them. A single two-class detector covers both object types. For video, an offline forward–backward tracker extends each mask across the frames in which the detector briefly loses the object, so a face that is detected in some frames is masked in all of them.

Highlights

  • Accurate on external benchmarks. Face AP50 of 80.6 on UFDD and 56.5 on PP4AV, and plate AP50 of 82.5 on PP4AV, against 65.8, 25.7 and 62.1 for EgoBlur Gen2.
  • Faces and plates in one model. D-FINE-X (HGNetv2-B5) at 1408 px input, trained on 119k images from five public datasets with class-verified partial labels.
  • Temporally complete masking. Offline forward–backward tracking removes 93% of the frames in which a face drops out of the mask between detections on MOT17 and MOT20.
  • Deployable. ONNX exports and a TensorRT 11 build path; 39 fps on 1080p video on one A100.

Explainer Video

Benchmarks

Every method is scored by the same evaluator (eval/evaluate_detector.py) on the same annotations: COCO AP and AP50, with each baseline run through its publisher's preprocessing at a 0.001 score floor (0.05 for CenterFace). UFDD and PP4AV are external benchmarks. The held-out and CRPD test sets are disjoint from training but come from sources that also contribute training images.

Faces.

MethodHeld-out AP50Held-out APUFDD AP50UFDD APPP4AV AP50PP4AV AP
YuNet (OpenCV Zoo)67.135.864.127.335.19.0
CenterFace (deface)69.637.269.930.227.16.4
YOLOv8n-face60.633.659.325.610.52.6
EgoBlur Gen164.437.564.627.726.37.1
EgoBlur Gen265.238.365.828.325.76.8
Ours, RT-DETRv2-X @128081.650.578.834.752.916.2
Ours, D-FINE-X @140883.452.380.636.056.517.7

License plates.

MethodHeld-out AP50Held-out APPP4AV AP50PP4AV APCRPD AP50CRPD AP
YOLO11x-plate79.944.240.814.890.652.0
EgoBlur Gen189.365.060.330.296.077.0
EgoBlur Gen289.864.562.130.294.873.3
Ours, RT-DETRv2-X @128091.064.474.738.495.072.4
Ours, D-FINE-X @140892.968.082.543.798.084.1

Recall at the recommended thresholds (IoU 0.5; masked area is the mean fraction of each image covered by masks with 20% padding).

MethodThresholds (face / plate)UFDD facePP4AV facePP4AV plateCRPD plateUFDD masked area
EgoBlur Gen10.9 / 0.947.011.214.889.42.7%
EgoBlur Gen20.674 / 0.74556.514.523.075.12.9%
Ours, D-FINE-X @14080.1 / 0.287.482.481.999.88.1%

Per-benchmark metric files, including threshold sweeps, size bins and mask coverage, are in results/metrics/; results/tables.md is generated from them.

Video: Forward–Backward Tracking

tracker/offline_tracker.py detects every frame at a low score floor, links detections into tracks forward and backward in time, and masks every frame of each confirmed track: its low-score detections, interpolated gaps, and a short extrapolation past its ends. Detections at the operating threshold are always masked, so the output never masks less than per-frame anonymization.

MOTChallenge provides pedestrian boxes but no face boxes, so we measure against the head region of each annotated pedestrian (visibility ≥ 0.5, height ≥ 100 px) on the MOT17 and MOT20 training sequences. A transient exposure is a frame in which a head is unmasked although it is masked within 1/3 s before and after.

Per-frameForward–backward tracking
Head-frames masked87.4%95.8%
Transient exposures4,540303
Late onset / early release1,531 / 1,640428 / 530

--face-confirm 0.2 confirms tracks from stronger detections and masks less of the frame (5.5% instead of 7.2% on these sequences) while still removing 87% of transient exposures.

Available Checkpoints

CheckpointArchitectureInputThresholds (face / plate)Use case
dfine_x_1408/model.pthD-FINE-X, HGNetv2-B514080.1 / 0.2Highest accuracy (recommended)
dfine_x_1408/model.onnxsame, ONNX opset 16, FP3214080.1 / 0.2ONNX Runtime
dfine_x_1408/model_amp_fp16.onnxsame, traced under FP16 autocast14080.1 / 0.2TensorRT 11, strongly typed
dfine_x_1408/tensorrt/model_trt11_fp16_b4.planTensorRT 11.3 engine, A10014080.1 / 0.2Fastest on A100 (39 fps at 1080p)
rtdetrv2_x_1280/model.pthRT-DETRv2-X, ResNet-10112800.1 / 0.1Faster video (56 fps at 1080p with TensorRT)

Each checkpoint folder contains its resolved config.yml. Weights are EMA weights without optimizer state.

Quick Start

Install the dependencies:

pip install -r requirements.txt

Download the repository:

huggingface-cli download mehmetkeremturkcan/UrbanAnonymizer --local-dir UrbanAnonymizer
cd UrbanAnonymizer

Images

python scripts/anonymize.py input.jpg output.jpg \
    --config dfine_x_1408/config.yml --checkpoint dfine_x_1408/model.pth \
    --size 1408 --face-score 0.1 --plate-score 0.2
import sys
sys.path.insert(0, "scripts")
from PIL import Image
from anonymize import Detector, apply_masks

detector = Detector("dfine_x_1408/config.yml", "dfine_x_1408/model.pth", device="cuda:0", size=1408)
image = Image.open("input.jpg")
detections = [d for d in detector.predict(image, score_threshold=0.1)
              if d["score"] >= (0.1 if d["category_id"] == 0 else 0.2)]   # 0 = face, 1 = license plate
apply_masks(image, detections, mode="opaque", padding=0.2).save("output.jpg")

Video

Offline, with forward–backward tracking (recommended):

python tracker/offline_tracker.py input.mp4 output.mp4 \
    --config dfine_x_1408/config.yml --checkpoint dfine_x_1408/model.pth --size 1408

Streaming, one frame at a time, with FFmpeg encoding:

python scripts/anonymize.py input.mp4 output.mp4 \
    --config dfine_x_1408/config.yml --checkpoint dfine_x_1408/model.pth \
    --size 1408 --face-score 0.1 --plate-score 0.2 \
    --frame-batch-size 4 --preprocess-workers 4 --video-writer ffmpeg --crf 18

TensorRT

dfine_x_1408/tensorrt/model_trt11_fp16_b4.plan is a strongly typed TensorRT 11.3 engine (batch 1–4) built from model_amp_fp16.onnx and validated against PyTorch on an A100. Install the runtime into its own directory and run:

pip install --target trt11 -r requirements-tensorrt.txt
python scripts/anonymize_tensorrt.py input.mp4 output.mp4 \
    --engine dfine_x_1408/tensorrt/model_trt11_fp16_b4.plan \
    --engine-metadata dfine_x_1408/tensorrt/tensorrt_build_provenance.json --trt-runtime-dir trt11 \
    --config dfine_x_1408/config.yml --size 1408 --face-score 0.1 --plate-score 0.2 \
    --frame-batch-size 4 --preprocess-workers 4 --video-writer ffmpeg --crf 18

TensorRT engines are specific to the GPU architecture and TensorRT version. For other GPUs, rebuild with scripts/build_tensorrt_engine.py --onnx dfine_x_1408/model_amp_fp16.onnx --size 1408 --precision fp32 --strongly-typed and validate the engine before use.

Reproducing the Comparison

eval/ contains the complete pipeline behind the benchmark tables:

ScriptPurpose
evaluate_detector.pyRuns our checkpoints (sharded) and scores any prediction files
run_egoblur.pyEgoBlur Gen1 and Gen2 with the official preprocessing and thresholds
run_baseline.pyCenterFace (deface), YuNet, YOLOv8n-face and YOLO11x-plate
download_baselines.shBaseline weights and the pinned EgoBlur code
compute_metrics.pyScores every method on every benchmark, threshold-free and at the recommended thresholds
make_tables.pyWrites results/tables.md and results/tables.json
../tracker/eval_mot_temporal.pyTemporal exposure analysis on MOT17 and MOT20

The held-out and CRPD test sets are part of the dataset repository; UFDD and PP4AV are obtained from their publishers and converted to the same COCO format in data/benchmarks/.

hf download mehmetkeremturkcan/UrbanAnonymizer-Dataset --repo-type dataset --local-dir data
for shard in data/data/test*.tar; do tar -xf "$shard" -C data; done
eval/download_baselines.sh

# predictions, one file per method and benchmark (shown for the held-out test set)
python eval/evaluate_detector.py --annotations data/annotations/test.json --image-root data \
    --config dfine_x_1408/config.yml --checkpoint dfine_x_1408/model.pth --size 1408 \
    --skip-metrics --output-prefix predictions/dfine_x_1408_heldout_s0of1
python eval/run_egoblur.py --annotations data/annotations/test.json --image-root data --generation gen2 \
    --min-score 0.001 --skip-metrics --output-prefix predictions/egoblur_gen2_heldout_s0of1
python eval/run_baseline.py --method centerface --annotations data/annotations/test.json --image-root data \
    --min-score 0.05 --output-prefix predictions/centerface_heldout_s0of1

# metrics and tables
python eval/compute_metrics.py --config eval/benchmarks.json --output-dir results/metrics
python eval/make_tables.py --metrics-dir results/metrics --output results/tables.md

All scripts accept --shard-index and --num-shards for parallel runs.

Dataset

The models are trained on UrbanAnonymizer-Dataset: 119,384 images and 347,427 face and plate boxes from Open Images, WIDER FACE, DARK FACE, CRPD and BirdsEye-RU, plus verified negative images, with per-image lists of the classes whose labels are complete.

Citation

@misc{turkcan2026urbananonymizer,
  title        = {UrbanAnonymizer: Face and License Plate Anonymization for Street-Level Images and Video},
  author       = {Turkcan, Mehmet Kerem},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/mehmetkeremturkcan/UrbanAnonymizer}}
}

License

The weights are released under CC BY-NC 4.0 because several training sources restrict commercial use. The bundled D-FINE and RT-DETR sources in external/ keep their Apache 2.0 licenses. Explainer footage: MOT17 and MOT20 (CC BY-NC-SA 3.0) and Wikimedia Commons clips under CC0, CC BY 3.0 and CC BY-SA 4.0, credited in the video.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · pytorch

Нельзя запустить

Архитектура d-fine неизвестна transformers в образе рантайма.

Класс архитектуры
DFINE
Ревизия весов
ef59b5e

0 моделей