MCPcopy Create free account
hub / github.com/MaureenZOU/TSAM / writeFlow

Function writeFlow

src/utils/visual_helper.py:156–163  ·  view source on GitHub ↗
(name, flow)

Source from the content-addressed store, hash-verified

154
155# save flow, I reference the code in scripts/run-flownet.py in flownet2-caffe project
156def writeFlow(name, flow):
157 f = open(name, 'wb')
158 f.write('PIEH'.encode('utf-8'))
159 np.array([flow.shape[1], flow.shape[0]], dtype=np.int32).tofile(f)
160 flow = flow.astype(np.float32)
161 flow.tofile(f)
162 f.flush()
163 f.close()
164
165
166def writeFlowImage(save_dir, data):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected