Skip to main content

Module yolox

Module yolox 

Source
Expand description

YOLOX (Ge et al., “YOLOX: Exceeding YOLO Series in 2021”) pre- and post-processing, independent of the inference runtime.

This is the contract of the official ONNX exports (release 0.1.1rc0, Apache-2.0), checked against YOLOX’s demo/ONNXRuntime pipeline:

  • Input images, (1, 3, H, W) f32: the image resized with its aspect ratio kept (bilinear) to fit W × H, placed at the top left, the rest filled with 114. Channels are BGR, values 0–255, not normalized. yolox_nano and yolox_tiny take 416 × 416, the larger models 640 × 640.
  • Output output, (1, N, 5 + C): per anchor (dx, dy, log w, log h) in its grid cell, then the objectness and C class probabilities, both already through a sigmoid. Anchors run over strides 8, 16 and 32, each grid row-major. C is 80 for the COCO models (COCO_CLASSES).

The score of a class is objectness × class probability. Boxes above the score threshold go through non-maximum suppression per class. The default threshold is low (0.1) because ByteTracker uses the low-score boxes in its second association.

Structs§

Letterbox
A preprocessed input tensor.
YoloxConfig
Input size and thresholds.
YoloxOutputError
The model output does not fit the configuration.

Constants§

COCO_CLASSES
The 80 COCO classes of the official YOLOX models, by class index.
MOVABLE_COCO_CLASSES
COCO classes that can move on their own: people, vehicles and animals. These are the candidates for the VIO’s moving-object filter (visloc_basalt::dynamic_objects); everything else is static structure.

Functions§

decode
Turn a raw output (anchors × (5 + C) values, the batch dimension dropped) into detections in image pixels, sorted by score, highest first.
letterbox
Resize image into the model input as described in the module docs.
non_maximum_suppression
Greedy non-maximum suppression: keep the best box, drop the ones that overlap it by more than iou_threshold, repeat.