Skip to content

Commit 5d8814f

Browse files
author
Clément Pinard
committed
transpose raw output shape to have a HW2 instead of 2HW
1 parent cdba31f commit 5d8814f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

run_inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def main():
109109
to_save = (rgb_flow * 255).astype(np.uint8).transpose(1,2,0)
110110
imwrite(filename + '.png', to_save)
111111
if args.output_value in ['raw', 'both']:
112-
np.save(filename + 'npy', flow_output.cpu().numpy())
112+
# Make the flow map a HxWx2 array as in .flo files
113+
to_save = flow_output.cpu().numpy().transpose(1,2,0)
114+
np.save(filename + '.npy', to_save)
113115

114116

115117
if __name__ == '__main__':

0 commit comments

Comments
 (0)