(
mask: Float[Tensor, "batch frame height width"],
shape: tuple[int, int],
)
| 48 | |
| 49 | @staticmethod |
| 50 | def rescale_mask( |
| 51 | mask: Float[Tensor, "batch frame height width"], |
| 52 | shape: tuple[int, int], |
| 53 | ) -> Float[Tensor, "batch frame height_scaled width_scaled"]: |
| 54 | b, f, _, _ = mask.shape |
| 55 | flow = rearrange(mask, "b f h w -> (b f) () h w") |
| 56 | flow = F.interpolate(flow, shape, mode="bilinear", align_corners=False) |
| 57 | return rearrange(flow, "(b f) () h w -> b f h w", b=b, f=f) |
| 58 | |
| 59 | @staticmethod |
| 60 | def compute_consistency_mask( |
no outgoing calls
no test coverage detected