MCPcopy Create free account
hub / github.com/HYUNJS/SGT / DeformConvWithOff

Class DeformConvWithOff

projects/CenterNet/centernet/deform_conv.py:32–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32class DeformConvWithOff(nn.Module):
33
34 def __init__(self, in_channels, out_channels,
35 kernel_size=3, stride=1, padding=1,
36 dilation=1, deformable_groups=1):
37 super(DeformConvWithOff, self).__init__()
38 self.offset_conv = nn.Conv2d(
39 in_channels,
40 deformable_groups * 2 * kernel_size * kernel_size,
41 kernel_size=kernel_size,
42 stride=stride,
43 padding=padding,
44 )
45 self.dcn = DeformConv(
46 in_channels, out_channels, kernel_size=kernel_size,
47 stride=stride, padding=padding, dilation=dilation,
48 deformable_groups=deformable_groups,
49 )
50
51 def forward(self, input):
52 offset = self.offset_conv(input)
53 output = self.dcn(input, offset)
54 return output
55
56
57class ModulatedDeformConvWithOff(nn.Module):

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected