(self, inputs)
| 82 | initialize_weights(self.final, self.bot_aspp, self.aspp) |
| 83 | |
| 84 | def forward(self, inputs): |
| 85 | x = inputs['images'] |
| 86 | x_size = x.size() |
| 87 | |
| 88 | _, _, final_features = self.backbone(x) |
| 89 | aspp = self.aspp(final_features) |
| 90 | aspp = self.bot_aspp(aspp) |
| 91 | pred = self.final(aspp) |
| 92 | pred = Upsample(pred, x_size[2:]) |
| 93 | |
| 94 | if self.training: |
| 95 | assert 'gts' in inputs |
| 96 | gts = inputs['gts'] |
| 97 | loss = self.criterion(pred, gts) |
| 98 | return loss |
| 99 | else: |
| 100 | output_dict = {'pred': pred} |
| 101 | return output_dict |
| 102 | |
| 103 | |
| 104 | def HRNet(num_classes, criterion, s2s4=None): |
nothing calls this directly
no test coverage detected