UltralyticsAssistant 2 months ago
parent 160eca3a3a
commit 43cf5f977a
  1. 15
      ultralytics/nn/modules/head.py

@ -592,7 +592,7 @@ class v10Detect(Detect):
class v11Detect(Detect): class v11Detect(Detect):
""" """
v11 Detection head V11 Detection head.
Args: Args:
nc (int): Number of classes. nc (int): Number of classes.
@ -602,7 +602,6 @@ class v11Detect(Detect):
__init__(self, nc=80, ch=()): Initializes the v11Detect object. __init__(self, nc=80, ch=()): Initializes the v11Detect object.
forward(self, x): Performs forward pass of the v11Detect module. forward(self, x): Performs forward pass of the v11Detect module.
bias_init(self): Initializes biases of the Detect module. bias_init(self): Initializes biases of the Detect module.
""" """
def __init__(self, nc=80, ch=()): def __init__(self, nc=80, ch=()):
@ -610,10 +609,10 @@ class v11Detect(Detect):
super().__init__(nc, ch) super().__init__(nc, ch)
c3 = max(ch[0], min(self.nc, 100)) # channels c3 = max(ch[0], min(self.nc, 100)) # channels
self.cv3 = nn.ModuleList( self.cv3 = nn.ModuleList(
nn.Sequential( nn.Sequential(
nn.Sequential(DWConv(x, x, 3), Conv(x, c3, 1)), nn.Sequential(DWConv(x, x, 3), Conv(x, c3, 1)),
nn.Sequential(DWConv(c3, c3, 3), Conv(c3, c3, 1)), nn.Sequential(DWConv(c3, c3, 3), Conv(c3, c3, 1)),
nn.Conv2d(c3, self.nc, 1), nn.Conv2d(c3, self.nc, 1),
)
for x in ch
) )
for x in ch
)

Loading…
Cancel
Save