RT-DETRv2-S-OpenVINO

RT-DETRv2-S for Intel NPUs, GPUs and CPUs: rtdetr_graphA_fp16 and rtdetr_graphB_fp16 from litert-community/RT-DETRv2-S-LiteRT as ONNX, OpenVINO IR with fp32 weights, and precompiled Intel NPU blobs. Call graph A (backbone and encoder) first, on a 640×640 image. A host step then builds graph B's inputs from A's outputs and that repo's host_params.bin. Graph B (decoder) returns 300 boxes and their class logits. The NPU of a Core Ultra 9 386H runs the blobs in 12.07 ms (A) and 86.90 ms (B).

Scripts, raw records, and the same table for all 52 graphs of LiteRT-Models: https://github.com/john-rocky/windows-zoo

Files

file bytes sha256
rtdetr_graphA_fp16.onnx 66,894,731 8051234addcc7bc922deab6e312ece2827b57769210c9a2faf08512f4b19926e
openvino/rtdetr_graphA_fp16.xml 1,155,004 2be2d4a287cd40220759c2d2e31f97d39fcf2032c5e7a0eeeec31a39c947a0bf
openvino/rtdetr_graphA_fp16.bin 66,193,692 c9193d60904cfd6718a9458008f7df3e83a6689fb4a044aeeb4cf1738e4cee01
npu/rtdetr_graphA_fp16.blob 40,214,664 39389b96c26d0a23231ce8af28fba81cab2cbc9d8fac2e6c825e768a2d64f40b
rtdetr_graphB_fp16.onnx 15,473,995 8b640ef467b76eea1f9d2c9081b5eebc2de483f38d10d72412e2870541fc469e
openvino/rtdetr_graphB_fp16.xml 1,380,382 b6cab68fac3a123f4c07faf55a717f35ae784706ed8251acf6d98febc1d3e5d3
openvino/rtdetr_graphB_fp16.bin 14,326,260 358ac2d60cfa71d1f874aa35f73d5d2f748e3926243049c11ab12167b8e0df1d
npu/rtdetr_graphB_fp16.blob 76,701,846 245080a4431ed44285c2b9d85c5a2e0b88afb13f275ae2e6cfb89208b0122a69

The NPU blobs were compiled with OpenVINO 2026.4.1, Intel NPU driver 32.0.100.4841 (OpenVINO reports NPU_DRIVER_VERSION 1004841, NPU_COMPILER_VERSION 524292). If import_model refuses a blob on another driver or OpenVINO version, compile the IR instead (the commented line in the snippet).

Conversion

The ONNX files were converted from the .tflite files with tf2onnx 1.17.0 (opset 17). tf2onnx 1.17.0 drops the bias of 13 FULLY_CONNECTED layers of rtdetr_graphA_fp16 and rtdetr_graphB_fp16; these files were converted with a one-line fix of that handler (convert/patch_tf2onnx.py in the GitHub repo), and their outputs match the .tflite.

How it was measured

MSI Stealth 16 AI+ (Core Ultra 9 386H, RTX 5080 Laptop GPU at a 95 W power limit, Windows 11 build 26200.9711, on AC power), 2026-11-07. On the laptop, each row is one process: load, one run, 5 warmup runs, then the median of 30 timed runs (2 warmup + 10 timed runs when the first run takes more than 3 s), numpy input to numpy output, every runtime at its default settings, one process at a time, each started after the CPU, the RTX and the Intel GPU had gone idle (the thresholds are in METHOD.md of the GitHub repo). Output check: each output against the CPU output in fp32 on the same input (ONNX Runtime's CPU EP); PASS = cosine ≥ 0.99, no NaN or Inf, and top-1 agreement ≥ 0.99 for class scores. No Snapdragon rows: Qualcomm AI Hub measured the files before the bias fix (its numbers are in the GitHub table).

rtdetr_graphA_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 12.07 0.03 PASS (cos ≥ 0.9999)
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 9.43 10.84 PASS (cos ≥ 0.9999)
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 9.81 1.27 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP fp16 copy of the .onnx (not in this repo) 6.54 1.19 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 7.23 1.21 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 58.65 0.33 reference

The ONNX file against the source .tflite (LiteRT interpreter on the CPU, the same input): PASS, cosine ≥ 0.9999 for every output.

rtdetr_graphB_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 86.90 0.05 PASS (cos ≥ 0.9999)
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 87.78 65.42 PASS (cos ≥ 0.9999)
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 35.46 1.25 FAIL: output_1_output: argmax agreement 265/300
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP fp16 copy of the .onnx (not in this repo) 8.23 1.19 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 9.68 0.86 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 76.36 0.15 reference

The ONNX file against the source .tflite (LiteRT interpreter on the CPU, the same input): PASS, cosine ≥ 0.9999 for every output.

Run it on the Intel NPU

Download this repo, then run the snippets from its folder:

pip install huggingface_hub
hf download mlboydaisuke/RT-DETRv2-S-OpenVINO --local-dir RT-DETRv2-S-OpenVINO
cd RT-DETRv2-S-OpenVINO

OpenVINO (pip install openvino==2026.4.1):

import numpy as np
import openvino as ov

core = ov.Core()
if "NPU" not in core.available_devices:
    raise SystemExit(f"no Intel NPU visible to OpenVINO: {core.available_devices}")
with open("npu/rtdetr_graphA_fp16.blob", "rb") as f:
    compiled = core.import_model(f.read(), "NPU")  # precompiled: no compile at load
# or compile the IR on this machine: compiled = core.compile_model("openvino/rtdetr_graphA_fp16.xml", "NPU")
# replace the zeros with your preprocessed input (float32, the shapes printed by compiled.inputs)
feeds = {i.get_any_name(): np.zeros(list(i.shape), np.float32) for i in compiled.inputs}
outputs = compiled(feeds)
print({o.get_any_name(): outputs[o].shape for o in compiled.outputs})

ONNX Runtime with the OpenVINO EP (pip install onnxruntime==1.31.1 onnxruntime-ep-openvino==1.8.1):

import numpy as np
import onnxruntime as ort
import onnxruntime_ep_openvino as ov_ep

ort.register_execution_provider_library(ov_ep.get_ep_name(), ov_ep.get_library_path())
npu = [d for d in ort.get_ep_devices()
       if d.ep_name == ov_ep.get_ep_name() and d.ep_metadata.get("ov_device") == "NPU"]
if not npu:
    raise SystemExit("no Intel NPU visible to the OpenVINO EP")
so = ort.SessionOptions()
so.add_provider_for_devices(npu, {})
sess = ort.InferenceSession("rtdetr_graphA_fp16.onnx", sess_options=so)  # compiles for the NPU here
# replace the zeros with your preprocessed input (float32)
feeds = {i.name: np.zeros(i.shape, np.float32) for i in sess.get_inputs()}
outputs = sess.run(None, feeds)
print([o.shape for o in outputs])

The same lines run rtdetr_graphB_fp16 with its own file names.

The Python on the LiteRT card has the rest: the preprocessing (img, x), the loading of host_params.bin from that repo (p, take), and the host step between the graphs (from enc_cls, mem = to ref =). Swap its run() for the lines above and give each graph its inputs by shape.

Branch windows-model-zoo

The branch windows-model-zoo adds the 2 files that windows-model-zoo runs. unfixed/: the conversion without the bias fix above. To use the model, take main's files.

Licence

Apache-2.0, the licence of litert-community/RT-DETRv2-S-LiteRT. The upstream model: PekingU/rtdetr_v2_r18vd.

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

Model tree for mlboydaisuke/RT-DETRv2-S-OpenVINO

Quantized
(1)
this model

Collection including mlboydaisuke/RT-DETRv2-S-OpenVINO