-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_normalized.py
22 lines (20 loc) · 990 Bytes
/
plot_normalized.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pickle
import numpy as np
import matplotlib.pyplot as plt
open_directory = "./goal_estimated_result/ETH_UCY (Normalized)/"
dataset = ['univ', 'eth', 'zara1', 'zara2', 'hotel']
save_image_directory = "./goal_estimated_result/ETH_UCY (Normalized)/"
for dataname in dataset:
open_error_file = open_directory + "goal_estimated_error_" + dataname + "_2.pkl"
open_estimation_file = open_directory + "goal_estimated_" + dataname + "_2.pkl"
error_file = open(open_error_file,'rb')
error = pickle.load(error_file)
error = np.concatenate(error['Estimated_Goal_Error'])
aver_error = sum(error) / len(error)
pedestrian = np.arange(0,len(error))
plt.hist(error, density=True)
plt.xlabel('L2-norm error')
plt.ylabel('The frequency of L2-norm error')
plt.title(f'The goal estimation on {dataname} with normalization\n Average L2-norm loss {aver_error}')
plt.savefig(save_image_directory + f'goal_estimated_histogram_{dataname}.png')
plt.show()