From 160eca3a3a241c5c03b623432274ea57022f03cc Mon Sep 17 00:00:00 2001 From: Francesco Mattioli Date: Fri, 4 Oct 2024 11:05:53 +0200 Subject: [PATCH] fixed docstrings --- ultralytics/nn/modules/head.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/ultralytics/nn/modules/head.py b/ultralytics/nn/modules/head.py index 3881b10003..a7c327c2a6 100644 --- a/ultralytics/nn/modules/head.py +++ b/ultralytics/nn/modules/head.py @@ -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 - )