RTMDet

RTMDet is a single-stage detector that predicts from one point-based prior per grid location, no anchors, through a head whose convolutions are shared across feature levels. LibreYOLO supports it for detection and RTMDet-Ins instance segmentation.

Tasks
detection, instance segmentation
Sizes
t, s, m, l, x at 640 px
Install
pip install libreyolo
Support tier
Supported, since v. Supporting trainables: kept green in CI, features land opportunistically.
Upstream
RTMDet by OpenMMLab, Apache-2.0. Paper, source
Licenses
Code Apache-2.0, weights Apache-2.0. Commercial use

Install

RTMDet needs no extra beyond the base package.

bash
pip install libreyolo

Predict

Weights download from Hugging Face on first use and are cached locally.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreRTMDets.pt")result = model(SAMPLE_IMAGE, save=True) for box in result.boxes:    print(box.cls, box.conf, box.xyxy)
CLI
libreyolo predict model=LibreRTMDets.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
Instance segmentation
from libreyolo import LibreYOLO, SAMPLE_IMAGE # The -seg suffix in the filename selects the RTMDet-Ins mask head,# so no task argument is needed here.model = LibreYOLO("LibreRTMDets-seg.pt")result = model(SAMPLE_IMAGE, save=True) print(result.masks.data.shape)

The returned Results object is the one every family returns, so swapping in a different detector is a one line change. A -seg filename resolves to the RTMDet-Ins task on its own, and result.masks then carries the instance masks alongside the boxes. conf sets the confidence threshold and iou the NMS threshold. See prediction for sources, streaming and result handling.

Variants

Five sizes, t through x, share one architecture at a common input resolution. This family carries no benchmark table here: compare sizes by checkpoint file size in the table below.

Train

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRTMDets.pt")model.train(    data="my-dataset.yaml",    epochs=300, imgsz=640, batch=16, lr0=0.004,)
CLI
libreyolo train model=LibreRTMDets.pt data=my-dataset.yaml imgsz=640 epochs=300 batch=16 lr0=0.004

Detection trains through train(). The QualityFocalLoss, GIoU and DynamicSoftLabelAssigner components are ported from upstream mmdetection, and the forward pass and ONNX export are bit-equivalent to it, with postprocessing matching mmdet's output within 0.001 mAP on val2017 subsets.

What has not been checked, per train()'s own docstring: small-dataset fine-tune convergence, from-scratch paper parity, multi-GPU behavior, cached Mosaic and MixUp throughput, the strict upstream two-stage pipeline switch, and the paramwise weight-decay overrides that zero decay on norm and bias parameters.

RTMDet-Ins has no training path. Calling train() on a -seg checkpoint, or with task="segment", raises NotImplementedError; instance segmentation supports inference and validation only.

train() also accepts a pretrained argument, but the value is never read inside the method: training always continues from whatever weights the model was constructed with, so pretrained=False does not reinitialize the network.

Left alone otherwise, the trainer runs 300 epochs with AdamW at lr0=0.004 and weight_decay=0.05, a 1-epoch warmup on a cosine schedule, and Mosaic and MixUp switched off for the final 20 epochs.

See training for datasets, augmentation, multi-GPU and loggers.

Validate

val() returns a dictionary of metrics/ keys covering precision, recall, mAP 50 and mAP 50-95, measured against any dataset in the format you trained on.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRTMDets.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])
CLI
libreyolo val model=LibreRTMDets.pt data=my-dataset.yaml
Instance segmentation
from libreyolo import LibreYOLO model = LibreYOLO("LibreRTMDets-seg.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95(M)"])   # masksprint(metrics["metrics/mAP50-95(B)"])   # boxes

Against a -seg checkpoint the plain metrics/mAP50-95 key holds the mask score, and the same run also reports boxes under (B) and masks under (M) so both are available from one pass.

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
DetectionDetection to ONNX: supported. Detection to TorchScript: supported. Detection to ExecuTorch: supported. Detection to TensorRT: supported. Detection to OpenVINO: supported. Detection to Paddle: not supportedDetection to MNN: not supportedDetection to RKNN: not supportedDetection to ncnn: not supportedDetection to TFLite: not supportedDetection to CoreML: not supportedDetection to Core AI: supported.
Instance segmentationInstance segmentation to ONNX: not supportedInstance segmentation to TorchScript: not supportedInstance segmentation to ExecuTorch: not supportedInstance segmentation to TensorRT: not supportedInstance segmentation to OpenVINO: not supportedInstance segmentation to Paddle: not supportedInstance segmentation to MNN: not supportedInstance segmentation to RKNN: not supportedInstance segmentation to ncnn: not supportedInstance segmentation to TFLite: not supportedInstance segmentation to CoreML: not supportedInstance segmentation to Core AI: not supported

Detection exports to most formats; instance segmentation currently exports to none of them; the matrix above reflects that split. An exported detection artifact loads back through LibreYOLO() on its file suffix, so a .onnx or .engine file behaves like a checkpoint and returns the same Results. Running the graph in a bare runtime, with no LibreYOLO installed, is also supported, but then preprocessing and postprocessing are yours to write.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreRTMDets.pt")model.export(format="onnx", imgsz=640)model.export(format="tensorrt", imgsz=640, half=True)
CLI
libreyolo export model=LibreRTMDets.pt format=onnx imgsz=640libreyolo export model=LibreRTMDets.pt format=tensorrt imgsz=640 half=True
Use the exported file
from libreyolo import LibreYOLO, SAMPLE_IMAGE # The factory routes on the file suffix, so an exported artifact loads# like any checkpoint and returns the same Results object.model = LibreYOLO("LibreRTMDets.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)

Checkpoints

Every published weight file for this family.

FileInput (px)Weights license
Detection
LibreRTMDett.pt640apache-2.0
LibreRTMDets.pt640apache-2.0
LibreRTMDetm.pt640apache-2.0
LibreRTMDetl.pt640apache-2.0
LibreRTMDetx.pt640apache-2.0
Instance segmentation
LibreRTMDett-seg.pt640apache-2.0
LibreRTMDets-seg.pt640apache-2.0
LibreRTMDetm-seg.pt640apache-2.0
LibreRTMDetl-seg.pt640apache-2.0
LibreRTMDetx-seg.pt640apache-2.0

Every file above exists in the LibreYOLO org today and downloads on first use.

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
RTMDet, OpenMMLab
Upstream license
Apache-2.0
LibreYOLO code
MIT
Weights
Apache-2.0, republished at huggingface.co/LibreYOLO
Interpretation
Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code, and weights you train yourself on your own data are yours. The published RTMDet and RTMDet-Ins checkpoints are converted from mmdetection's own COCO weights, trained by OpenMMLab under the same license.

Citation

@misc{lyu2022rtmdet,
      title={RTMDet: An Empirical Study of Designing Real-Time Object Detectors},
      author={Chengqi Lyu and Wenwei Zhang and Haian Huang and Yue Zhou and Yudong Wang and Yanyi Liu and Shilong Zhang and Kai Chen},
      year={2022},
      eprint={2212.07784},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Copied from the authors' citation block at github.com/open-mmlab/mmdetection/tree/main/configs/rtmdet#citation.

Verified against LibreYOLO v1.5.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.