Forward pass. Args: x (tensor): input data (image) Returns: tensor: depth
(self, x)
| 47 | self.load(path) |
| 48 | |
| 49 | def forward(self, x): |
| 50 | """Forward pass. |
| 51 | |
| 52 | Args: |
| 53 | x (tensor): input data (image) |
| 54 | |
| 55 | Returns: |
| 56 | tensor: depth |
| 57 | """ |
| 58 | |
| 59 | layer_1 = self.pretrained.layer1(x) |
| 60 | layer_2 = self.pretrained.layer2(layer_1) |
| 61 | layer_3 = self.pretrained.layer3(layer_2) |
| 62 | layer_4 = self.pretrained.layer4(layer_3) |
| 63 | |
| 64 | layer_1_rn = self.scratch.layer1_rn(layer_1) |
| 65 | layer_2_rn = self.scratch.layer2_rn(layer_2) |
| 66 | layer_3_rn = self.scratch.layer3_rn(layer_3) |
| 67 | layer_4_rn = self.scratch.layer4_rn(layer_4) |
| 68 | |
| 69 | path_4 = self.scratch.refinenet4(layer_4_rn) |
| 70 | path_3 = self.scratch.refinenet3(path_4, layer_3_rn) |
| 71 | path_2 = self.scratch.refinenet2(path_3, layer_2_rn) |
| 72 | path_1 = self.scratch.refinenet1(path_2, layer_1_rn) |
| 73 | |
| 74 | out = self.scratch.output_conv(path_1) |
| 75 | |
| 76 | return torch.squeeze(out, dim=1) |
nothing calls this directly
no outgoing calls
no test coverage detected