| 489 | param.requires_grad = False |
| 490 | |
| 491 | def forward_encoder(self, frames, depths, cond_times=None): |
| 492 | mask = torch.ones_like(depths) # dummy mask |
| 493 | max_depth = depths.flatten(1).max(dim=1)[0][:, None, None, None, None] |
| 494 | min_depth = depths.flatten(1).min(dim=1)[0][:, None, None, None, None] |
| 495 | target_depth = depths # without normalization |
| 496 | input_depth = (depths - min_depth) / (max_depth - min_depth) |
| 497 | |
| 498 | frames = torch.cat([frames, input_depth], dim=2) |
| 499 | encoder_output = self.encoder(frames, cond_times) |
| 500 | |
| 501 | return encoder_output, target_depth, mask |
| 502 | |
| 503 | def upsampling(self, output): |
| 504 | input_views = output.shape[1] |