MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / _ASPPModuleDeformable

Class _ASPPModuleDeformable

models/modules/aspp.py:71–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70##################### Deformable
71class _ASPPModuleDeformable(nn.Module):
72 def __init__(self, in_channels, planes, kernel_size, padding):
73 super(_ASPPModuleDeformable, self).__init__()
74 self.atrous_conv = DeformableConv2d(in_channels, planes, kernel_size=kernel_size,
75 stride=1, padding=padding, bias=False)
76 self.bn = nn.BatchNorm2d(planes) if config.batch_size > 1 else nn.Identity()
77 self.relu = nn.ReLU(inplace=True)
78
79 def forward(self, x):
80 x = self.atrous_conv(x)
81 x = self.bn(x)
82
83 return self.relu(x)
84
85
86class ASPPDeformable(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected