| 191 | x= self.low_classifier(x8) + self.high_classifier(x) |
| 192 | return x |
| 193 | class Exp2_Decoder4(nn.Module): |
| 194 | def __init__(self, num_classes,channels): |
| 195 | super().__init__() |
| 196 | channels8,channels16=channels["8"],channels["16"] |
| 197 | self.head8=ConvBnAct(channels8,32,1) |
| 198 | self.head16=ConvBnAct(channels16,128,1) |
| 199 | self.conv=ConvBnAct(128+32,128,3,1,1) |
| 200 | self.classifier=nn.Conv2d(128, num_classes, 1) |
| 201 | |
| 202 | def forward(self, x): |
| 203 | #intput_shape=x.shape[-2:] |
| 204 | x8, x16=x["8"],x["16"] |
| 205 | x16=self.head16(x16) |
| 206 | x16 = F.interpolate(x16, size=x8.shape[-2:], mode='bilinear', align_corners=False) |
| 207 | x8=self.head8(x8) |
| 208 | x=torch.cat((x8, x16), dim=1) |
| 209 | x=self.conv(x) |
| 210 | x=self.classifier(x) |
| 211 | return x |
| 212 | |
| 213 | class Exp2_Decoder10(nn.Module): |
| 214 | def __init__(self, num_classes,channels): |