MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / __init__

Method __init__

yolox/models/network_blocks.py:150–178  ·  view source on GitHub ↗

Args: in_channels (int): input channels. out_channels (int): output channels. n (int): number of Bottlenecks. Default value: 1.

(
        self,
        in_channels,
        out_channels,
        n=1,
        shortcut=True,
        expansion=0.5,
        depthwise=False,
        act="silu",
    )

Source from the content-addressed store, hash-verified

148 """C3 in yolov5, CSP Bottleneck with 3 convolutions"""
149
150 def __init__(
151 self,
152 in_channels,
153 out_channels,
154 n=1,
155 shortcut=True,
156 expansion=0.5,
157 depthwise=False,
158 act="silu",
159 ):
160 """
161 Args:
162 in_channels (int): input channels.
163 out_channels (int): output channels.
164 n (int): number of Bottlenecks. Default value: 1.
165 """
166 # ch_in, ch_out, number, shortcut, groups, expansion
167 super().__init__()
168 hidden_channels = int(out_channels * expansion) # hidden channels
169 self.conv1 = BaseConv(in_channels, hidden_channels, 1, stride=1, act=act)
170 self.conv2 = BaseConv(in_channels, hidden_channels, 1, stride=1, act=act)
171 self.conv3 = BaseConv(2 * hidden_channels, out_channels, 1, stride=1, act=act)
172 module_list = [
173 Bottleneck(
174 hidden_channels, hidden_channels, shortcut, 1.0, depthwise, act=act
175 )
176 for _ in range(n)
177 ]
178 self.m = nn.Sequential(*module_list)
179
180 def forward(self, x):
181 x_1 = self.conv1(x)

Callers

nothing calls this directly

Calls 3

BaseConvClass · 0.85
BottleneckClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected