RF-DETR-Nano-OpenVINO

RF-DETR-Nano for Intel NPUs, GPUs and CPUs: rfdetr_graphA_fp16 and rfdetr_graphB_fp16 from litert-community/RF-DETR-Nano-LiteRT as ONNX, OpenVINO IR with fp32 weights, and precompiled Intel NPU blobs. Call graph A (backbone and encoder) first, on a 384×384 image. A host step keeps the boxes of its 300 top-scoring proposals. Graph B (decoder) takes them with A's memory and returns 300 boxes and class logits. The NPU of a Core Ultra 9 386H runs the blobs in 18.54 ms (A) and 14.99 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
rfdetr_graphA_fp16.onnx 96,705,955 6bdbf0d3a0c943d484a404935d0b3119d8e52cc79003c6ee26efe3298a7723c7
openvino/rfdetr_graphA_fp16.xml 2,876,884 5f7f8119155043114216d8663fe86e9d40662e5756d56077affc98057d8ef79d
openvino/rfdetr_graphA_fp16.bin 93,922,448 06f1bcab729ad7152aec97d3070b715b5ac0949cf25eb3ea237aafe727538263
npu/rfdetr_graphA_fp16.blob 58,495,119 8af903d2fa7106339c3258488cff4823e1190ead5d12e10cc2d6a227e9b31f10
rfdetr_graphB_fp16.onnx 14,245,186 c60c3f9fee15d6cd5d3e1cdfdf280e0c0bcd42caa6f7fc802b2ebeb6e07163ae
openvino/rfdetr_graphB_fp16.xml 597,302 9260f0cd32551eed10b0da9a030c7671f03ecb9d6e2f251e598cc3291b8f64c3
openvino/rfdetr_graphB_fp16.bin 13,853,228 ea0db8800ceee469a00354443ad0a949cd08c18bf5a928b21650d78be415b8d7
npu/rfdetr_graphB_fp16.blob 12,058,767 2b637e1fcbe7f1bf65d6ef785ea92fb607ed6ce670ea7e220dcb3f738764c2cd

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 5 FULLY_CONNECTED layers of rfdetr_graphA_fp16 and rfdetr_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).

rfdetr_graphA_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 18.54 0.05 PASS (cos ≥ 0.9998)
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 18.80 29.67 PASS (cos ≥ 0.9999)
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 16.10 2.04 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) 14.25 1.36 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 23.87 2.13 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 60.66 0.37 reference

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

rfdetr_graphB_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 14.99 0.01 PASS (cos ≥ 0.9999)
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 14.54 3.92 PASS (cos ≥ 0.9999)
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 3.90 1.01 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) 3.44 1.22 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 3.33 1.08 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 13.56 0.08 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/RF-DETR-Nano-OpenVINO --local-dir RF-DETR-Nano-OpenVINO
cd RF-DETR-Nano-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/rfdetr_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/rfdetr_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("rfdetr_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 rfdetr_graphB_fp16 with its own file names.

The Python on the LiteRT card has the rest: the preprocessing (img, x) and the host step between the graphs (from enc_cls, enc_coord, mem = to ts =). Swap its run() for the lines above and give each graph its inputs by shape.

Licence

Apache-2.0, the licence of litert-community/RF-DETR-Nano-LiteRT. The upstream model: Roboflow/rf-detr-nano.

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/RF-DETR-Nano-OpenVINO

Quantized
(1)
this model

Collection including mlboydaisuke/RF-DETR-Nano-OpenVINO