Luxonis OAK Deployment for Ultralytics YOLO#
Luxonis OAK cameras run Ultralytics YOLO models on-device after conversion with Luxonis tooling. This is a manual deployment workflow; Luxonis is not a native Ultralytics model.export(format="...") target.
This guide covers RVC2 and RVC4 devices. Convert for your camera's platform: RVC2 and RVC4 artifacts are not interchangeable. Supported model families and tasks vary; check the Luxonis Tools support matrix before conversion.
Start with a supported YOLO .pt checkpoint, such as yolo26n.pt, or your own trained model. The converted NN Archive packages the model and runtime metadata.
Cloud Conversion with Luxonis Hub#
- Sign in to Luxonis Hub and open Quick Conversion.
- Select YOLO, choose RVC2 or RVC4, and upload your
.ptcheckpoint. - Set the input shape and conversion parameters, then submit the conversion.
- After completion, copy the converted model's identifier for the inference example below, or download its NN Archive.
For automated conversion or custom RVC4 calibration data, use the HubAI SDK. Follow its installation instructions in a Python 3.10+ environment. Detailed Conversion provides registry management and predefined calibration datasets.
Local Conversion with Tools and ModelConverter#
Use Python 3.10+ and Docker. Install Luxonis Tools using its upstream setup instructions, including the dependency constraints. Tools prepares YOLO outputs for Luxonis parsing; a generic ONNX export does not replace this step.
# Export the checkpoint to an ONNX NN Archive
tools yolo26n.pt --imgsz "640 640" --output-dir output
# Install the target-platform converter
pip install modelconv==0.6.0Tools writes yolo26n.tar.xz inside a timestamped directory under output/. Replace the example path below with that file. For RVC4 INT8 conversion, populate calibration_images/ with representative deployment images; see the calibration data requirements.
modelconverter convert rvc4 --path output/yolo26n_20260807_104858/yolo26n.tar.xz \
calibration.path calibration_images/For RVC2, use rvc2 instead of rvc4; calibration images are not needed for its FP16 conversion. Use the resulting compiled NN Archive from ModelConverter's output directory for inference, rather than the intermediate ONNX archive. See ModelConverter for output paths and platform-specific options.
Run Inference on an OAK Camera#
Connect a compatible OAK camera and install DepthAI in your Python environment:
pip install depthai==3.9.0For a private Hub model, set DEPTHAI_HUB_API_KEY to a Luxonis Hub API key before running the script. Replace your-model-identifier with the identifier from Hub, or use the local compiled NN Archive alternative.
import depthai as dai
model = "your-model-identifier"
# Alternatively, use your converted local artifact:
# model = dai.NNArchive("path/to/model.rvc4.tar.xz")
visualizer = dai.RemoteConnection()
with dai.Pipeline() as pipeline:
camera = pipeline.create(dai.node.Camera).build()
detection = pipeline.create(dai.node.DetectionNetwork).build(camera, model)
visualizer.addTopic("rgb", detection.passthrough, group="RGB")
visualizer.addTopic("detections", detection.out, group="RGB")
pipeline.start()
visualizer.registerPipeline(pipeline)
while pipeline.isRunning():
if visualizer.waitKey(1) == ord("q"):
pipeline.stop()Open http://localhost:8082 to view the RGB stream and detections. DetectionNetwork also supports compatible instance segmentation and pose models. For other tasks, including semantic segmentation and classification, follow the task-specific inference guidance.
For stereo depth pipelines, see the spatial detection example. Measure your model on the target camera using the benchmarking guide; throughput depends on the model, input size, precision, and pipeline configuration.