|
|
|
@ -592,32 +592,28 @@ class v10Detect(Detect): |
|
|
|
|
|
|
|
|
|
class v11Detect(Detect): |
|
|
|
|
""" |
|
|
|
|
v10 Detection head from https://arxiv.org/pdf/2405.14458. |
|
|
|
|
v11 Detection head |
|
|
|
|
|
|
|
|
|
Args: |
|
|
|
|
nc (int): Number of classes. |
|
|
|
|
ch (tuple): Tuple of channel sizes. |
|
|
|
|
|
|
|
|
|
Attributes: |
|
|
|
|
max_det (int): Maximum number of detections. |
|
|
|
|
|
|
|
|
|
Methods: |
|
|
|
|
__init__(self, nc=80, ch=()): Initializes the v10Detect object. |
|
|
|
|
forward(self, x): Performs forward pass of the v10Detect module. |
|
|
|
|
__init__(self, nc=80, ch=()): Initializes the v11Detect object. |
|
|
|
|
forward(self, x): Performs forward pass of the v11Detect module. |
|
|
|
|
bias_init(self): Initializes biases of the Detect module. |
|
|
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
def __init__(self, nc=80, ch=()): |
|
|
|
|
"""Initializes the v10Detect object with the specified number of classes and input channels.""" |
|
|
|
|
"""Initializes the v11Detect object with the specified number of classes and input channels.""" |
|
|
|
|
super().__init__(nc, ch) |
|
|
|
|
c3 = max(ch[0], min(self.nc, 100)) # channels |
|
|
|
|
# Light cls head |
|
|
|
|
self.cv3 = nn.ModuleList( |
|
|
|
|
nn.Sequential( |
|
|
|
|
nn.Sequential(DWConv(x, x, 3), Conv(x, c3, 1)), |
|
|
|
|
nn.Sequential(DWConv(c3, c3, 3), Conv(c3, c3, 1)), |
|
|
|
|
nn.Conv2d(c3, self.nc, 1), |
|
|
|
|
nn.Sequential( |
|
|
|
|
nn.Sequential(DWConv(x, x, 3), Conv(x, c3, 1)), |
|
|
|
|
nn.Sequential(DWConv(c3, c3, 3), Conv(c3, c3, 1)), |
|
|
|
|
nn.Conv2d(c3, self.nc, 1), |
|
|
|
|
) |
|
|
|
|
for x in ch |
|
|
|
|
) |
|
|
|
|
for x in ch |
|
|
|
|
) |
|
|
|
|