Heliosoph/yolox-onnx
YOLOX — ONNX (full size ladder)
ONNX bundle of Megvii-BaseDetection/YOLOX covering all seven published size variants in a single repo. Apache-2.0 licensed alternative to Ultralytics YOLOv8 (which is AGPL-3.0).
Not converted locally — these are the ONNX checkpoints Megvii publishes alongside YOLOX itself.
Credit: Megvii.
What this repo contains
All variants share the same 80-class COCO label set and the same input/output tensor signature — you can swap sizes without rewriting inference code.
How to use
import onnxruntime as ort
import numpy as np
sess = ort.InferenceSession("yolox_s.onnx")
# Input: [1, 3, 640, 640] float32, RGB, NOT normalized (YOLOX expects raw [0,255]).
# Letterbox-pad images to 640x640 maintaining aspect ratio before feeding.
outputs = sess.run(None, {"images": img_tensor})[0]
# Outputs: [1, 8400, 85]
# 8400 = anchor predictions (P3/P4/P5 grids combined)
# 85 = (cx, cy, w, h, obj_conf, *80 class probs)
# Decode by multiplying obj_conf × max(class_probs), apply NMS.Reference postprocessing in Python and C++: Megvii's YOLOX/demo/ONNXRuntime.
Which one should I use?
- CPU / mobile / NPU:
yolox_nanooryolox_tiny - General-purpose:
yolox_s(the recommended default) - GPU, accuracy matters:
yolox_loryolox_x - `yolox_darknet` is included for reproducibility but the CSPDarknet-backbone variants above generally supersede it.
Why not YOLOv8?
YOLOv8 (Ultralytics) is AGPL-3.0 — using it in commercial or closed-source software triggers strong copyleft obligations. YOLOX is Apache-2.0 and roughly comparable on accuracy. The DatumV catalog uses YOLOX as the default detector for this reason.
License
Apache-2.0 — same as upstream. LICENSE file included.
