View Source YOLO.Models.YOLOX (YOLO v0.2.0)
YOLOX model implementation for preprocessing input images and postprocessing detections using non-maximum suppression (NMS).
Supports YOLOX models found at https://github.com/Megvii-BaseDetection/YOLOX
If using a YOLOX model that was exported with --decode_in_inference
, you can set
decode_head: false
in the YOLO.detect/3 options.
YOLOX-Tiny and YOLOX-Nano models use 416x416, while other models use 640x640.
Summary
Functions
Calculates the detection score for each prediction as the product of the maximum class probability and the objectness score.
Post-processes the model's raw output to produce a filtered list of detected objects.
YOLOX input doesn't need to be normalized, so we resize and convert the image to a {batch_size, channels, height, width}
tensor.
Functions
Calculates the detection score for each prediction as the product of the maximum class probability and the objectness score.
Adaptation of YOLO.NMS.filter_predictions/2, but calculates the correct score based on the product of the maximum class probability and the objectness score which differs from Ultralytics
Removes prob_threshold filtering so that we can use Nx.Defn compilation for performance.
Post-processes the model's raw output to produce a filtered list of detected objects.
Options:
decode_head
- If true, decode the output head to map predictions to input image space. Defaults totrue
. Can be set tofalse
if using a YOLOX model that was exported with--decode_in_inference
nms_fun
- Optional custom NMS function. Must calculate detection scores as the product of the maximum class probability and the objectness score.prob_threshold
- Minimum probability threshold for detectionsiou_threshold
- IoU threshold for non-maximum suppression
@spec preprocess(YOLO.Model.t(), term(), Keyword.t()) :: {Nx.Tensor.t(), YOLO.FrameScalers.ScalingConfig.t()}
YOLOX input doesn't need to be normalized, so we resize and convert the image to a {batch_size, channels, height, width}
tensor.
Tiny and Nano models use 416x416, while other models use 640x640.