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

Class BaseConv

yolox/models/network_blocks.py:29–54  ·  view source on GitHub ↗

A Conv2d -> Batchnorm -> silu/leaky relu block

Source from the content-addressed store, hash-verified

27
28
29class BaseConv(nn.Module):
30 """A Conv2d -> Batchnorm -> silu/leaky relu block"""
31
32 def __init__(
33 self, in_channels, out_channels, ksize, stride, groups=1, bias=False, act="silu"
34 ):
35 super().__init__()
36 # same padding
37 pad = (ksize - 1) // 2
38 self.conv = nn.Conv2d(
39 in_channels,
40 out_channels,
41 kernel_size=ksize,
42 stride=stride,
43 padding=pad,
44 groups=groups,
45 bias=bias,
46 )
47 self.bn = nn.BatchNorm2d(out_channels)
48 self.act = get_activation(act, inplace=True)
49
50 def forward(self, x):
51 return self.act(self.bn(self.conv(x)))
52
53 def fuseforward(self, x):
54 return self.act(self.conv(x))
55
56
57class DWConv(nn.Module):

Callers 12

_make_cblMethod · 0.85
__init__Method · 0.85
make_group_layerMethod · 0.85
make_spp_blockMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected