.. _ai-yolox-detection-example: Object detection ================ Load YOLOX into the AI inference handler, run detection on a few camera frames, and print per-frame fetch / detect timings. .. note:: ``load_model`` creates an ONNX Runtime session on the appliance and keeps it resident until you call :meth:`~olo.ai.Model.unload` (or exit a ``with`` / ``try``/``finally`` that unloads). Expect a noticeable load delay, and the first :meth:`~olo.ai.yolo.YoloDetector.detect` call is often slower than later ones (session and accelerator warmup). Reuse one loaded session across frames rather than loading per image. .. tab-set:: :sync-group: sdk-language .. tab-item:: Python :sync: python .. literalinclude:: scripts/ai-yolox-detection.py :language: python .. tab-item:: TypeScript :sync: typescript .. literalinclude:: scripts/ai-yolox-detection.ts :language: typescript