DFL
Bases: nn.Module
Integral module of Distribution Focal Loss (DFL). Proposed in Generalized Focal Loss https://ieeexplore.ieee.org/document/9792391
Source code in ultralytics/nn/modules/block.py
__init__(c1=16)
Initialize a convolutional layer with a given number of input channels.
Source code in ultralytics/nn/modules/block.py
forward(x)
Applies a transformer layer on input tensor 'x' and returns a tensor.
Proto
Bases: nn.Module
YOLOv8 mask Proto module for segmentation models.
Source code in ultralytics/nn/modules/block.py
HGStem
Bases: nn.Module
StemBlock of PPHGNetV2 with 5 convolutions and one maxpool2d. https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/modeling/backbones/hgnet_v2.py
Source code in ultralytics/nn/modules/block.py
forward(x)
Forward pass of a PPHGNetV2 backbone layer.
Source code in ultralytics/nn/modules/block.py
HGBlock
Bases: nn.Module
HG_Block of PPHGNetV2 with 2 convolutions and LightConv. https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/modeling/backbones/hgnet_v2.py
Source code in ultralytics/nn/modules/block.py
forward(x)
SPP
Bases: nn.Module
Spatial Pyramid Pooling (SPP) layer https://arxiv.org/abs/1406.4729.
Source code in ultralytics/nn/modules/block.py
__init__(c1, c2, k=(5, 9, 13))
Initialize the SPP layer with input/output channels and pooling kernel sizes.
Source code in ultralytics/nn/modules/block.py
forward(x)
SPPF
Bases: nn.Module
Spatial Pyramid Pooling - Fast (SPPF) layer for YOLOv5 by Glenn Jocher.
Source code in ultralytics/nn/modules/block.py
forward(x)
C1
Bases: nn.Module
CSP Bottleneck with 1 convolution.
Source code in ultralytics/nn/modules/block.py
C2
Bases: nn.Module
CSP Bottleneck with 2 convolutions.
Source code in ultralytics/nn/modules/block.py
C2f
Bases: nn.Module
CSP Bottleneck with 2 convolutions.
Source code in ultralytics/nn/modules/block.py
forward(x)
forward_split(x)
Forward pass using split() instead of chunk().
C3
Bases: nn.Module
CSP Bottleneck with 3 convolutions.
Source code in ultralytics/nn/modules/block.py
C3x
Bases: C3
C3 module with cross-convolutions.
Source code in ultralytics/nn/modules/block.py
__init__(c1, c2, n=1, shortcut=True, g=1, e=0.5)
Initialize C3TR instance and set default parameters.
Source code in ultralytics/nn/modules/block.py
RepC3
Bases: nn.Module
Rep C3.
Source code in ultralytics/nn/modules/block.py
C3TR
Bases: C3
C3 module with TransformerBlock().
Source code in ultralytics/nn/modules/block.py
__init__(c1, c2, n=1, shortcut=True, g=1, e=0.5)
Initialize C3Ghost module with GhostBottleneck().
C3Ghost
Bases: C3
C3 module with GhostBottleneck().
Source code in ultralytics/nn/modules/block.py
__init__(c1, c2, n=1, shortcut=True, g=1, e=0.5)
Initialize 'SPP' module with various pooling sizes for spatial pyramid pooling.
Source code in ultralytics/nn/modules/block.py
GhostBottleneck
Bases: nn.Module
Ghost Bottleneck https://github.com/huawei-noah/ghostnet.
Source code in ultralytics/nn/modules/block.py
Bottleneck
Bases: nn.Module
Standard bottleneck.
Source code in ultralytics/nn/modules/block.py
BottleneckCSP
Bases: nn.Module
CSP Bottleneck https://github.com/WongKinYiu/CrossStagePartialNetworks.
Source code in ultralytics/nn/modules/block.py
forward(x)
Created 2023-05-11, Updated 2023-05-17
Authors: Glenn Jocher (3)