Runtime Backends¶
OpenDetect uses ONNX Runtime execution providers (EPs). Provider selection is automatic and ordered by capability.
Selection Rules¶
Provider resolution currently follows this order:
CoreML (macOS)
NVIDIA stack (TensorRT RTX, TensorRT, CUDA)
AMD stack (ROCM, MIGraphX)
DirectML (Windows)
OpenVINO (Intel)
CPU fallback
You control behavior with:
hardware_acceleration: defaultTrue, setFalseto force CPUtensor_rt: defaultFalse, setTrueto allow TensorRT providersmixed_precision: defaultFalseat CLI, can be enabled for FP16/TF32-friendly paths
TensorRT Setup¶
pip install "opendetect[tensorrt]" is not sufficient by itself.
You must also install a compatible TensorRT system stack:
NVIDIA driver compatible with your GPU.
CUDA toolkit and cuDNN compatible with your ONNX Runtime GPU package.
TensorRT runtime/libraries from NVIDIA (matching CUDA major version).
Python environment with
opendetect[tensorrt].
Verification:
import onnxruntime as ort
print(ort.get_available_providers())
You should see TensorrtExecutionProvider (or NvTensorRtRtxExecutionProvider) and CUDAExecutionProvider.
CLI usage:
opendetect-infer --image input.jpg --model-id rfdetr-m --tensor-rt --mixed-precision
Known limitation:
YOLOX
m/l/xare not currently supported on TensorRT due to export/runtime compatibility issues.
Intel and AMD Support Status¶
OpenDetect already includes selection logic for:
Intel:
OpenVINOExecutionProviderAMD:
ROCMExecutionProvider,MIGraphXExecutionProviderWindows GPU path:
DmlExecutionProvider/DirectMLExecutionProvider
Current status:
implementation-level support exists in code
formal hardware validation is pending for Intel and AMD environments
contributions with tested setup notes are welcome
Troubleshooting¶
If acceleration is not used, print available providers and verify expected EP names.
Confirm your ONNX Runtime build matches the desired hardware backend.
Fall back to
--no-hardware-accelerationto confirm functional CPU inference first.