Initialize MonodepthWithEncodingAdaptor. Args: monodepth_predictor: The monodepth model. return_encoder_features: Whether to return encoder features from monodepth model. return_decoder_features: Whether to return decoder features from monodepth model.
(
self,
monodepth_predictor: MonodepthDensePredictionTransformer,
return_encoder_features: bool,
return_decoder_features: bool,
num_monodepth_layers: int,
sorting_monodepth: bool,
)
| 168 | """Monodepth model with feature maps.""" |
| 169 | |
| 170 | def __init__( |
| 171 | self, |
| 172 | monodepth_predictor: MonodepthDensePredictionTransformer, |
| 173 | return_encoder_features: bool, |
| 174 | return_decoder_features: bool, |
| 175 | num_monodepth_layers: int, |
| 176 | sorting_monodepth: bool, |
| 177 | ): |
| 178 | """Initialize MonodepthWithEncodingAdaptor. |
| 179 | |
| 180 | Args: |
| 181 | monodepth_predictor: The monodepth model. |
| 182 | return_encoder_features: Whether to return encoder features from monodepth model. |
| 183 | return_decoder_features: Whether to return decoder features from monodepth model. |
| 184 | num_monodepth_layers: How many layers the monodepth model predicts. |
| 185 | sorting_monodepth: Whether to sort the monodepth output (for two layer monodepth). |
| 186 | """ |
| 187 | super().__init__() |
| 188 | self.monodepth_predictor = monodepth_predictor |
| 189 | self.return_encoder_features = return_encoder_features |
| 190 | self.return_decoder_features = return_decoder_features |
| 191 | self.num_monodepth_layers = num_monodepth_layers |
| 192 | self.sorting_monodepth = sorting_monodepth |
| 193 | |
| 194 | def forward(self, image: torch.Tensor) -> MonodepthOutput: |
| 195 | """Process image and return disparity and feature maps.""" |