MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / flow_warp

Function flow_warp

diffusers/examples/community/rerender_a_video.py:83–89  ·  view source on GitHub ↗
(feature, flow, mask=False, mode="bilinear", padding_mode="zeros")

Source from the content-addressed store, hash-verified

81
82
83def flow_warp(feature, flow, mask=False, mode="bilinear", padding_mode="zeros"):
84 b, c, h, w = feature.size()
85 assert flow.size(1) == 2
86
87 grid = coords_grid(b, h, w).to(flow.device) + flow # [B, 2, H, W]
88 grid = grid.to(feature.dtype)
89 return bilinear_sample(feature, grid, mode=mode, padding_mode=padding_mode, return_mask=mask)
90
91
92def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, beta=0.5):

Callers 3

get_warped_and_maskFunction · 0.70
denoising_loopMethod · 0.70

Calls 3

coords_gridFunction · 0.70
bilinear_sampleFunction · 0.70
toMethod · 0.45

Tested by

no test coverage detected