Create depth alignment.
(
params: AlignmentParams, depth_decoder_dim: int | None = None
)
| 20 | |
| 21 | |
| 22 | def create_alignment( |
| 23 | params: AlignmentParams, depth_decoder_dim: int | None = None |
| 24 | ) -> nn.Module | None: |
| 25 | """Create depth alignment.""" |
| 26 | if depth_decoder_dim is None: |
| 27 | raise ValueError("Requires depth_decoder_dim for LearnedAlignment.") |
| 28 | alignment = LearnedAlignment( |
| 29 | depth_decoder_features=params.depth_decoder_features, |
| 30 | depth_decoder_dim=depth_decoder_dim, |
| 31 | steps=params.steps, |
| 32 | stride=params.stride, |
| 33 | base_width=params.base_width, |
| 34 | activation_type=params.activation_type, |
| 35 | ) |
| 36 | |
| 37 | if params.frozen: |
| 38 | alignment.requires_grad_(False) |
| 39 | |
| 40 | return alignment |
| 41 | |
| 42 | |
| 43 | class LearnedAlignment(nn.Module): |
no test coverage detected