Skip to content

Commit

Permalink
fixed sign of flow and .flo file format (swapped order of horizontal …
Browse files Browse the repository at this point in the history
…and vertical flow)
  • Loading branch information
StefanoWoerner committed May 26, 2018
1 parent 8cff45e commit 8f76a31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main(_):
model = VGG16FlowSearch()
im1 = imread(os.path.join(root, FLAGS.image1))
im2 = imread(os.path.join(root, FLAGS.image2))
flow = model.infer(im1, im2, d_range=[[FLAGS.ymin,FLAGS.ymax],[FLAGS.xmin,FLAGS.xmax]],
flow = -1 * model.infer(im1, im2, d_range=[[FLAGS.ymin,FLAGS.ymax],[FLAGS.xmin,FLAGS.xmax]],
step=[FLAGS.ystep,FLAGS.xstep])

if FLAGS.plot:
Expand All @@ -71,7 +71,8 @@ def main(_):
f.write('PIEH'.encode('ascii'))
h,w,d = flow.shape
np.array([w, h]).astype(np.int32).tofile(f)
np.reshape(flow, -1).astype(np.float32).tofile(f)
# Format flow for .flo file extension
np.reshape(flow[:,:,::-1], -1).astype(np.float32).tofile(f)

if __name__ == '__main__':
tf.app.run()

0 comments on commit 8f76a31

Please sign in to comment.