MCPcopy Create free account
hub / github.com/dcharatan/flowmap / compute_flows

Function compute_flows

flowmap/flow/__init__.py:24–33  ·  view source on GitHub ↗
(
    batch: Batch,
    flow_shape: tuple[int, int],
    device: torch.device,
    cfg: FlowPredictorCfg,
)

Source from the content-addressed store, hash-verified

22
23@torch.no_grad()
24def 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)

Callers 1

overfitFunction · 0.85

Calls 3

get_flow_predictorFunction · 0.85
toMethod · 0.45

Tested by

no test coverage detected