MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / initialize_flow

Method initialize_flow

core/raft.py:63–70  ·  view source on GitHub ↗

Flow is represented as difference between two coordinate grids flow = coords1 - coords0

(self, img)

Source from the content-addressed store, hash-verified

61 m.eval()
62
63 def initialize_flow(self, img):
64 """ Flow is represented as difference between two coordinate grids flow = coords1 - coords0"""
65 N, C, H, W = img.shape
66 coords0 = coords_grid(N, H//8, W//8).to(img.device)
67 coords1 = coords_grid(N, H//8, W//8).to(img.device)
68
69 # optical flow computed as difference: flow = coords1 - coords0
70 return coords0, coords1
71
72 def upsample_flow(self, flow, mask):
73 """ Upsample flow field [H/8, W/8, 2] -> [H, W, 2] using convex combination """

Callers 1

forwardMethod · 0.95

Calls 1

coords_gridFunction · 0.90

Tested by

no test coverage detected