-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvis_result.py
89 lines (69 loc) · 1.81 KB
/
vis_result.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python
# coding: utf-8
# In[4]:
import numpy as np
import vis_utils
import command
from IPython.display import Image, display
# dataset = "dummy"
dataset = "debug"
# dataset = "bricks"
# dataset = "bricks_1slide"
# dataset = "indoor_flying2"
# dataset = "qr000"
# cmd = ['source', '/opt/intel/oneapi/setvars.sh', "--force"]
# res = command.run(cmd)
bin_path = 'result/{}/bin/flo_{:1d}_{:05d}.bin'
png_path = 'result/{}/png/flo_{:1d}_{:05d}.png'
if dataset=="indoor_flying2":
B, W, H, C = 2921002, 368,288, 2
n_itr_show = 1
WINSIZE = 1000
n_itr = B//WINSIZE
# n_itr = 10|
b_show=False
run_cpp= False
cmd = ['./process', '-1', dataset]
elif dataset=="qr000":
B, W, H, C = 1418870, 1312,752, 2
n_itr_show = 1
WINSIZE = 1000
n_itr = B//WINSIZE
# n_itr = 10|
b_show=False
run_cpp= False
cmd = ['./process', '-1', dataset]
elif dataset=="debug":
dataset="bricks"
B, W, H, C = 15000, 272,208, 2
n_itr_show = 10
WINSIZE = 15000
n_itr = 100
b_show=True
run_cpp= True
cmd = ['./process', '-1', "bricks", '15000']
else:
B, W, H, C = 15000, 272,208, 2
n_itr_show = 1
WINSIZE = 1000
n_itr = B//WINSIZE
b_show=True
run_cpp= True
cmd = ['./process', '-1', dataset]
# n_itr = 10
if run_cpp:
res = command.run(cmd)
print(res.output)
print(res.exit)
for index in [0]:
for itr in range(n_itr):
if itr%n_itr_show==0:
print(itr)
bin_path_ = bin_path.format(dataset, index, itr)
png_path_ = png_path.format(dataset, index, itr)
flo = np.fromfile(bin_path_, dtype=np.float64).reshape([H,W,C])
flow_vis.save_flo(flo, png_path_)
if b_show:
display(Image(filename=png_path_))
print(flo.shape)
# In[ ]: