Skip to main content

sppf

Function sppf 

Source
pub fn sppf<D: Float>(
    c_in: usize,
    c_out: usize,
    shortcut: bool,
) -> impl Fn(SymTensor) -> SymTensor
Expand description

Spatial Pyramid Pooling - Fast (SPPF).

Matches ultralytics.nn.modules.block.SPPF(c1, c2, k=5, n=3, shortcut): cv1: Conv(c1, c//2, 1, 1, act=False) — Conv+BN only, no SiLU pool: MaxPool2d(k=5, stride=1, padding=2) applied 3 times cv2: Conv(4 * c//2, c2, 1, 1) — Conv+BN+SiLU shortcut: residual add (output + input) when shortcut=true and c_in==c_out (YOLO26 passes shortcut=true; default is false)