Lightweight 3x3 convolution.
1x1 (linear) + dw 3x3 (nonlinear).
Definition at line 138 of file osnet.py.
◆ __init__()
| fastreid.modeling.backbones.osnet.LightConv3x3.__init__ |
( |
| self, |
|
|
| in_channels, |
|
|
| out_channels, |
|
|
| bn_norm ) |
Definition at line 143 of file osnet.py.
143 def __init__(self, in_channels, out_channels, bn_norm):
144 super(LightConv3x3, self).__init__()
145 self.conv1 = nn.Conv2d(
146 in_channels, out_channels, 1, stride=1, padding=0, bias=False
147 )
148 self.conv2 = nn.Conv2d(
149 out_channels,
150 out_channels,
151 3,
152 stride=1,
153 padding=1,
154 bias=False,
155 groups=out_channels
156 )
157 self.bn = get_norm(bn_norm, out_channels)
158 self.relu = nn.ReLU(inplace=True)
159
◆ forward()
| fastreid.modeling.backbones.osnet.LightConv3x3.forward |
( |
| self, |
|
|
| x ) |
Definition at line 160 of file osnet.py.
160 def forward(self, x):
161 x = self.conv1(x)
162 x = self.conv2(x)
163 x = self.bn(x)
164 x = self.relu(x)
165 return x
166
167
◆ bn
| fastreid.modeling.backbones.osnet.LightConv3x3.bn |
◆ conv1
| fastreid.modeling.backbones.osnet.LightConv3x3.conv1 |
◆ conv2
| fastreid.modeling.backbones.osnet.LightConv3x3.conv2 |
◆ relu
| fastreid.modeling.backbones.osnet.LightConv3x3.relu |
The documentation for this class was generated from the following file:
- smreid/fastreid/modeling/backbones/osnet.py