forked from merlinwu/end_to_end_visual_odometry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_results.py
37 lines (29 loc) · 869 Bytes
/
plot_results.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
import numpy as np
import sys
import os.path
import matplotlib.pyplot as plt
filenames = ['fc.npy',
'fc_xyz.npy',
'fc_ypr.npy',
'se3.npy',
'se3_quat.npy',
'se3_val.npy',
'se3_xyz.npy',
'total.npy']
if len(sys.argv) is not 2:
raise ValueError('Need to provide results directory')
results_path = sys.argv[1]
found_files = []
for filename in filenames:
found_files.append(os.path.isfile(results_path + filename))
if not any(found_files):
raise ValueError('No result files in directory')
for i in range(len(filenames)):
if found_files[i]:
plt.figure()
data = np.load(results_path + filenames[i])
data = data[~(data==0).all(1)]
data = np.mean(data, axis=1)
plt.semilogy(data)
plt.title(filenames[i])
plt.show()