| 69 | |
| 70 | ##################### Deformable |
| 71 | class _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 | |
| 86 | class ASPPDeformable(nn.Module): |