Skip to content

Commit cb1659b

Browse files
committed
Update & add dependencies
- path.py has been renamed to path: reflect this in requirements.txt and update API usage in run_inference.py (namebase method does not exists anymore) - add tqdm and scipy as explicit dependencies
1 parent 40e64a9 commit cb1659b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ spatial-correlation-sampler>=0.2.1
55
tensorboardX>=1.4
66
imageio
77
argparse
8-
path.py
8+
path
9+
tqdm
10+
scipy

run_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main():
7171
for ext in args.img_exts:
7272
test_files = data_dir.files('*1.{}'.format(ext))
7373
for file in test_files:
74-
img_pair = file.parent / (file.namebase[:-1] + '2.{}'.format(ext))
74+
img_pair = file.parent / (file.basename().splitext()[0][:-1] + '2.{}'.format(ext))
7575
if img_pair.isfile():
7676
img_pairs.append([file, img_pair])
7777

@@ -103,7 +103,7 @@ def main():
103103
if args.upsampling is not None:
104104
output = F.interpolate(output, size=img1.size()[-2:], mode=args.upsampling, align_corners=False)
105105
for suffix, flow_output in zip(['flow', 'inv_flow'], output):
106-
filename = save_path/'{}{}'.format(img1_file.namebase[:-1], suffix)
106+
filename = save_path/'{}{}'.format(img1_file.basename().splitext()[0][:-1], suffix)
107107
if args.output_value in['vis', 'both']:
108108
rgb_flow = flow2rgb(args.div_flow * flow_output, max_value=args.max_flow)
109109
to_save = (rgb_flow * 255).astype(np.uint8).transpose(1,2,0)

0 commit comments

Comments
 (0)