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

Method __init__

yolox/models/darknet.py:98–165  ·  view source on GitHub ↗
(
        self,
        dep_mul,
        wid_mul,
        out_features=("dark3", "dark4", "dark5"),
        depthwise=False,
        act="silu",
    )

Source from the content-addressed store, hash-verified

96
97class CSPDarknet(nn.Module):
98 def __init__(
99 self,
100 dep_mul,
101 wid_mul,
102 out_features=("dark3", "dark4", "dark5"),
103 depthwise=False,
104 act="silu",
105 ):
106 super().__init__()
107 assert out_features, "please provide output features of Darknet"
108 self.out_features = out_features
109 Conv = DWConv if depthwise else BaseConv
110
111 base_channels = int(wid_mul * 64) # 64
112 base_depth = max(round(dep_mul * 3), 1) # 3
113
114 # stem
115 self.stem = Focus(3, base_channels, ksize=3, act=act)
116
117 # dark2
118 self.dark2 = nn.Sequential(
119 Conv(base_channels, base_channels * 2, 3, 2, act=act),
120 CSPLayer(
121 base_channels * 2,
122 base_channels * 2,
123 n=base_depth,
124 depthwise=depthwise,
125 act=act,
126 ),
127 )
128
129 # dark3
130 self.dark3 = nn.Sequential(
131 Conv(base_channels * 2, base_channels * 4, 3, 2, act=act),
132 CSPLayer(
133 base_channels * 4,
134 base_channels * 4,
135 n=base_depth * 3,
136 depthwise=depthwise,
137 act=act,
138 ),
139 )
140
141 # dark4
142 self.dark4 = nn.Sequential(
143 Conv(base_channels * 4, base_channels * 8, 3, 2, act=act),
144 CSPLayer(
145 base_channels * 8,
146 base_channels * 8,
147 n=base_depth * 3,
148 depthwise=depthwise,
149 act=act,
150 ),
151 )
152
153 # dark5
154 self.dark5 = nn.Sequential(
155 Conv(base_channels * 8, base_channels * 16, 3, 2, act=act),

Callers

nothing calls this directly

Calls 4

FocusClass · 0.85
CSPLayerClass · 0.85
SPPBottleneckClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected