(
batch: Batch,
flow_shape: tuple[int, int],
device: torch.device,
cfg: FlowPredictorCfg,
)
| 22 | |
| 23 | @torch.no_grad() |
| 24 | def compute_flows( |
| 25 | batch: Batch, |
| 26 | flow_shape: tuple[int, int], |
| 27 | device: torch.device, |
| 28 | cfg: FlowPredictorCfg, |
| 29 | ) -> Flows: |
| 30 | print("Precomputing optical flow.") |
| 31 | flow_predictor = get_flow_predictor(cfg) |
| 32 | flow_predictor.to(device) |
| 33 | return flow_predictor.compute_bidirectional_flow(batch.to(device), flow_shape) |
no test coverage detected