-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_all_kitti_stereo.py
65 lines (55 loc) · 1.52 KB
/
run_all_kitti_stereo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
import sys
import subprocess
import httplib
#### arguments ####
alg = sys.argv[1]
dataset = sys.argv[2]
maxdisp = '256'
scale = '1'
####
#### configuration ####
use_lab = '0'
####
folder = 'testdata/kitti_stereo_flow/' + dataset
left_folder = folder + '/colored_0/'
right_folder = folder + '/colored_1/'
#datasets = subprocess.check_output(['ls', path]).split()
left = ''
right = ''
left_result = ''
right_result = ''
def run_test_with_dataset(alg) :
""" path should end with a / """
what = subprocess.check_output([
'./bin/main/'+alg+'.bin',
left, right,
maxdisp, scale,
left_result,
'1', #fullsize,
use_lab,
])
print what
#for dataset in datasets :
# subprocess.check_output(['mkdir', 'bin/cviu/kitti'+maxdisp])
result_folder = 'results/kitti_stereo/'
subprocess.check_output(['mkdir','-p',result_folder])
result_sha = dataset + '_' + alg
result_folder += result_sha + '/'
subprocess.check_output(['mkdir','-p',result_folder])
result_folder += 'data/'
subprocess.check_output(['mkdir','-p',result_folder])
pic_names = subprocess.check_output(['ls', left_folder]).split()
for pic in pic_names :
if pic.endswith('10.png') :
# print pic[-7:]
left = left_folder + pic
print left
right = right_folder + pic
print right
left_result= result_folder + pic
# print dataset
print left_result
run_test_with_dataset(alg)
print subprocess.check_output(['bin/checker/evaluate_stereo.bin',
result_sha])