Skip to main content

Module detect_decode

Module detect_decode 

Source
Expand description

Kernel that decodes raw detection head output into boxes/scores/classes. Fused dist2bbox decode Triton kernel for YOLO detection post-processing.

Converts raw LTRB distance predictions from a detection head into XYWH world-coordinate boxes, fusing the dist2bbox conversion and stride-scaling into a single kernel pass.

Layout:

  • boxes: [B, 4, A] — raw LTRB distances
  • anchor_x: [A] — anchor centre x per anchor
  • anchor_y: [A] — anchor centre y per anchor
  • strides: [A] — stride scale per anchor
  • out: [B, 4, A] — decoded XYWH boxes in world coordinates

Parallelism: one CTA per (batch, BLOCK_A-wide anchor tile). Grid: B * cdiv(A, BLOCK_A) flat CTAs.

Structs§

DetectDecodeForward
Fused dist2bbox + stride-scale decode: LTRB distances → XYWH world coords.
DetectDecodeOp
Graph-level representation of the detect_decode op.
DetectDecodeRuntimeOp
Runtime dispatch for the detect_decode kernel.

Functions§

detect_decode_forward
Fused dist2bbox + stride-scale decode: LTRB distances → XYWH world coords.