(
flow: Float[Tensor, "batch frame height width 2"],
shape: tuple[int, int],
)
| 38 | |
| 39 | @staticmethod |
| 40 | def rescale_flow( |
| 41 | flow: Float[Tensor, "batch frame height width 2"], |
| 42 | shape: tuple[int, int], |
| 43 | ) -> Float[Tensor, "batch frame height_scaled width_scaled 2"]: |
| 44 | b, f, _, _, _ = flow.shape |
| 45 | flow = rearrange(flow, "b f h w xy -> (b f) xy h w") |
| 46 | flow = F.interpolate(flow, shape, mode="bilinear", align_corners=False) |
| 47 | return rearrange(flow, "(b f) xy h w -> b f h w xy", b=b, f=f) |
| 48 | |
| 49 | @staticmethod |
| 50 | def rescale_mask( |
no outgoing calls
no test coverage detected