Apply UNet to image. Args: features: The input multi-level feature map from encoder. Returns: The output feature map.
(self, features: list[torch.Tensor])
| 94 | ) |
| 95 | |
| 96 | def forward(self, features: list[torch.Tensor]) -> torch.Tensor: |
| 97 | """Apply UNet to image. |
| 98 | |
| 99 | Args: |
| 100 | features: The input multi-level feature map from encoder. |
| 101 | |
| 102 | Returns: |
| 103 | The output feature map. |
| 104 | """ |
| 105 | i_feature_layer = len(features) - 1 |
| 106 | out = self.convs_up[0](features[i_feature_layer]) |
| 107 | i_feature_layer -= 1 |
| 108 | for conv_up in self.convs_up[1:]: # type: ignore |
| 109 | out = conv_up(torch.cat([out, features[i_feature_layer]], dim=1)) |
| 110 | i_feature_layer -= 1 |
| 111 | out = self.conv_out(torch.cat([out, features[i_feature_layer]], dim=1)) |
| 112 | |
| 113 | return out |
nothing calls this directly
no outgoing calls
no test coverage detected