Skip to content

Commit cbbc263

Browse files
authored
Update run_inference.py
flow_output[0]. squeeze does the same trick
1 parent d62f7d9 commit cbbc263

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ def main():
105105
for suffix, flow_output in zip(['flow', 'inv_flow'], output):
106106
filename = save_path/'{}{}'.format(img1_file.namebase[:-1], suffix)
107107
if args.output_value in['vis', 'both']:
108-
rgb_flow = flow2rgb(args.div_flow * flow_output, max_value=args.max_flow)
108+
rgb_flow = flow2rgb(args.div_flow * flow_output[0], max_value=args.max_flow)
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']:
112112
# Make the flow map a HxWx2 array as in .flo files
113-
to_save = (args.div_flow*flow_output).cpu().numpy().transpose(1,2,0)
113+
to_save = (args.div_flow*flow_output[0]).cpu().numpy().transpose(1,2,0)
114114
np.save(filename + '.npy', to_save)
115115

116116

0 commit comments

Comments
 (0)