/ Модель

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

Лицензия
AGPL 3.0
Библиотека
pytorch
Опубликована
10 сен 2026

rtdetr-to-yolo-distill

Поиск объектовИзображение → bounding_boxes3 профессии
0скачиваний за 30 дней0лайковвеса обновлены27 сен 2026

Описание модели

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

Компактная YOLO26n, обученная дистилляцией RT-DETR-R50vd для обнаружения объектов на снимках с дронов из набора VisDrone-DET.

RTDETR-To-YOLO-Distill — набор весов и ONNX-моделей для обнаружения объектов на аэрофотоснимках с дронов. В работе RT-DETR-R50vd выступает учителем, а компактная свёрточная YOLO26n — учеником; по данным карточки, у ученика в 17 раз меньше параметров. Модель обучена на VisDrone-DET для распознавания десяти классов: пешеходов, людей, велосипедов, автомобилей, фургонов, грузовиков, трициклов, моторикш и автобусов.

Обучение включает дистилляцию знаний с псевдометками, передачей логитов и признаков; для ONNX-файлов также подготовлена посттренировочная INT8-квантизация с контролем падения точности. Модель рассчитана на инференс и дообучение, а не на возобновление исходного обучения. Экспортированные модели принимают RGB-изображение фиксированного размера 736×1280 с масштабированием значений в диапазон [0, 1]; YOLO26n возвращает до 300 детекций без NMS. Для TensorRT требуется отдельно собрать движок под конкретную версию TensorRT и GPU. Лицензия — AGPL-3.0.

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

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

  • обнаружение пешеходов на снимках с дронов
  • подсчёт автомобилей и грузовиков на аэрофотоснимках
  • поиск велосипедов и трициклов в видеокадрах с дронов
  • обнаружение автобусов и моторикш на изображениях VisDrone
  • развёртывание детектора объектов через ONNX и TensorRT

Ограничения

Обучена и оценена только на снимках с дронов, поэтому на наземных и спутниковых изображениях точность может снизиться; обнаружение мелких объектов остаётся слабым. Экспортированные входы имеют фиксированный размер 736×1280 и batch 1, а результаты обучения основаны на одном запуске.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

RTDETR-To-YOLO-Distill

Weights for RTDETR-To-YOLO-Distill: an RT-DETR-R50vd transformer teacher distilled into a YOLO26n CNN student (17× fewer parameters) for aerial object detection on VisDrone-DET, under label scarcity, with accuracy-gated INT8 post-training quantization and TensorRT export.

The training code, method, and full results are in the GitHub repository. This card covers the released files and how to use them.

Files

All scores are on the VisDrone-DET test-dev set (1,610 images), clean condition, confidence threshold 0.001.

FileModelTrainingmAP@0.5:0.95mAP@0.5
rtdetr_r50vd_full/rtdetr_best.pthRT-DETR-R50vd teacherSupervised, full label budget (6,471 images)26.5544.15
rtdetr_r50vd_full/rtdetr_best_fp32.onnxsame, FP32 ONNX—26.5644.20
rtdetr_r50vd_full/rtdetr_best_int8.onnxsame, INT8 Q/DQ ONNXTensorRT engine built from this file26.5944.19
yolo26n_semi-supervised_eighth/yolo_manual_best_semi-supervised-soft-feat_eighth.pthYOLO26n studentSemi-supervised + soft logit and feature KD, 805 labelled images (one-eighth budget)16.3428.72
yolo26n_teacher-only_full/yolo_manual_best_teacher-only-soft-feat.pthYOLO26n studentZero human boxes: teacher pseudo-labels + soft logit and feature KD19.8234.34
yolo26n_supervised-kd_full/yolo_manual_best_kd-soft-feat.pthYOLO26n studentSupervised + soft logit and feature KD, full label budget20.0434.04
yolo26n_supervised-kd_full/yolo_manual_best_kd-soft-feat_fp32.onnxsame, FP32 ONNX—20.0434.06
yolo26n_supervised-kd_full/yolo_manual_best_kd-soft-feat_int8.onnxsame, INT8 Q/DQ ONNXTensorRT engine built from this file; detection head kept in FP3219.4133.02

The .pth files hold the EMA weights under ema["module"] plus the run's lineage metadata (training regime, label budget, provenance). Optimizer and scheduler state were removed, so these are for inference and fine-tuning, not for resuming the original runs. They load with torch.load(..., weights_only=True).

TensorRT engines are not included: an engine is tied to the TensorRT version and GPU it was built on. Build one from the ONNX files as shown below.

Input and output

Both architectures take a single fixed-shape input and were exported with opset 17 and a static batch of 1.

Input nameimages
Shape[1, 3, 736, 1280] (N, C, H, W), float32
PreprocessingRGB; plain resize to 736×1280 (no letterbox, aspect ratio not preserved); scale to [0, 1]; no mean/std normalization

YOLO26n is NMS-free. Output output0 has shape [1, 300, 6]: [x1, y1, x2, y2, score, class] per detection, sorted by score, in input-pixel coordinates (736×1280). Rescale x by original_width / 1280 and y by original_height / 736.

RT-DETR-R50vd outputs pred_logits [1, 300, 10] (apply a sigmoid; take the max over classes per query) and pred_boxes [1, 300, 4] as normalized (cx, cy, w, h). Multiply by the original image size directly.

Classes (index → name): 0 pedestrian, 1 people, 2 bicycle, 3 car, 4 van, 5 truck, 6 tricycle, 7 awning-tricycle, 8 bus, 9 motor.

Usage

ONNX Runtime, without the repository

import cv2
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download

REPO = "pooryanh/rtdetr-to-yolo-distill"
H, W = 736, 1280

def preprocess(path):
    img = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)
    x = cv2.resize(img, (W, H)).astype(np.float32) / 255.0
    return x.transpose(2, 0, 1)[None], img.shape[:2]

x, (h, w) = preprocess("frame.jpg")

# YOLO26n student
onnx_path = hf_hub_download(REPO, "yolo26n_supervised-kd_full/yolo_manual_best_kd-soft-feat_fp32.onnx")
sess = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
det = sess.run(None, {"images": x})[0][0]            # (300, 6)
det = det[det[:, 4] >= 0.25]
det[:, [0, 2]] *= w / W
det[:, [1, 3]] *= h / H                              # x1, y1, x2, y2, score, class

# RT-DETR-R50vd teacher
onnx_path = hf_hub_download(REPO, "rtdetr_r50vd_full/rtdetr_best_fp32.onnx")
sess = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
logits, boxes = sess.run(None, {"images": x})
scores = 1.0 / (1.0 + np.exp(-logits[0]))            # (300, 10)
cls, conf = scores.argmax(-1), scores.max(-1)
keep = conf >= 0.25
cx, cy, bw, bh = boxes[0][keep].T
xyxy = np.stack([(cx - bw / 2) * w, (cy - bh / 2) * h, (cx + bw / 2) * w, (cy + bh / 2) * h], axis=1)

With the repository: evaluation and TensorRT

git clone https://github.com/pouryahoseini/RTDETR-To-YOLO-Distill
cd RTDETR-To-YOLO-Distill && pip install -r requirements.txt
python src/prepare_dataset.py                       # VisDrone -> COCO manifests

# PyTorch checkpoints
python src/evaluate.py --model yolo_manual --weights yolo_manual_best_kd-soft-feat.pth
python src/evaluate.py --model rtdetr --weights rtdetr_best.pth

# Build and evaluate a TensorRT engine from the INT8 ONNX (TensorRT 11)
python src/trt_export.py --onnx yolo_manual_best_kd-soft-feat_int8.onnx --precision int8
python src/evaluate.py --model trt --onnx-arch yolo --weights yolo_manual_best_kd-soft-feat_int8.engine

Training

  • Data: VisDrone-DET, 10 classes; 6,471 train / 548 val / 1,610 test-dev images. Label budgets (half 3,249, quarter 1,546, eighth 805 images) are nested and split by flight sequence, so no sequence appears in both a labelled and an unlabelled pool.
  • Teacher: RT-DETR-R50vd (v1), initialized from the COCO + Objects365 pretrained checkpoint, 60 epochs at 736×1280. For each budget, the teacher is trained on the same labelled subset as the student.
  • Students: YOLO26n, initialized from Ultralytics' COCO-pretrained yolo26n.pt, 50 epochs at 736×1280.
  • Distillation: hard pseudo-labels from the teacher, decoupled soft logit KD (top-1 BCE for confidence plus softmax KL for inter-class relations), and feature KD with per-instance normalized foreground masks through a 1×1 conv + GroupNorm adapter.
  • Quantization: post-training INT8 with percentile calibration on 300 training images, strongly-typed Q/DQ graphs for TensorRT 11, and an accuracy gate of at most 2.0 mAP@0.5:0.95 drop.

Limitations

  • Trained and evaluated on drone imagery only; expect degraded accuracy on ground-level or satellite views.
  • VisDrone is mostly clear-weather; the robustness augmentation is synthetic.
  • Every result comes from a single training run (one seed).
  • Small objects remain hard: AP on small objects is below 10 for every YOLO26n student.
  • The released zero-human-box student (yolo26n_teacher-only_full) learns from the full-budget teacher, which was trained on all 6,471 labelled images, so it removes human boxes from student training, not from the pipeline.
  • Inputs are a fixed 736×1280 with batch 1; other shapes require re-export.

License

Released under AGPL-3.0. The YOLO26n students are fine-tuned from Ultralytics yolo26n.pt (AGPL-3.0). The RT-DETR-R50vd teacher derives from RT-DETR (Apache-2.0). All models were trained on VisDrone-DET, which its authors release under CC BY-NC-SA 3.0 for academic use only; these weights are therefore intended for non-commercial research use. Commercial use of the YOLO models additionally requires an Ultralytics Enterprise License.

Citation

If you use these weights, please link the GitHub repository and cite the works they build on:

@article{zhu2021detection,
  title   = {Detection and Tracking Meet Drones Challenge},
  author  = {Zhu, Pengfei and Wen, Longyin and Du, Dawei and Bian, Xiao and Fan, Heng and Hu, Qinghua and Ling, Haibin},
  journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  volume  = {44},
  number  = {11},
  pages   = {7380--7399},
  year    = {2021}
}

@inproceedings{zhao2024detrs,
  title     = {DETRs Beat YOLOs on Real-time Object Detection},
  author    = {Zhao, Yian and Lv, Wenyu and Xu, Shangliang and Wei, Jinman and Wang, Guanzhong and Dang, Qingqing and Liu, Yi and Chen, Jie},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  pages     = {16965--16974},
  year      = {2024}
}

@software{ultralytics_yolo,
  author  = {Jocher, Glenn and Qiu, Jing},
  title   = {Ultralytics YOLO},
  url     = {https://github.com/ultralytics/ultralytics},
  license = {AGPL-3.0}
}

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

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

GPU в ailist

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

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

Библиотека «pytorch» рантаймом не поддерживается.

Ревизия весов
ca8ddd2

0 моделей