-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_eval_offline.py
65 lines (58 loc) · 3.18 KB
/
test_eval_offline.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 numpy as np
def eval_at_40points():
sum = [0, 0, 0]
for v in range(3):
for i in range(1, len(data)):
sum[v] += data[:, v + 1][i]
print("car_detection_3d AP: {} {} {}".format(sum[0] / 40 * 100, sum[1] / 40 * 100, sum[2] / 40 * 100))
def eval_at_11points():
sum = [0, 0, 0]
for v in range(3):
for i in range(0, len(data), 4):
sum[v] += data[:, v + 1][i]
print("car_detection_3d AP: {} {} {}".format(sum[0] / 11 * 100, sum[1] / 11 * 100, sum[2] / 11 * 100))
if __name__ == '__main__':
# data can be found at http://www.cvlibs.net/datasets/kitti/eval_object_detail.php?&result=672d5d8a671ed0a6a06df16e87aeffe301dcefd1
data = np.array([0.000000, 0.371295, 1.000000, 1.000000,
0.025000, 0.371295, 0.482714, 0.492806,
0.050000, 0.371295, 0.454383, 0.472138,
0.075000, 0.360524, 0.449523, 0.441424,
0.100000, 0.360524, 0.419588, 0.398163,
0.125000, 0.360524, 0.383439, 0.353302,
0.150000, 0.360524, 0.342580, 0.298475,
0.175000, 0.351283, 0.310442, 0.104185,
0.200000, 0.332176, 0.243738, 0.000000,
0.225000, 0.323867, 0.091153, 0.000000,
0.250000, 0.300303, 0.000000, 0.000000,
0.275000, 0.267305, 0.000000, 0.000000,
0.300000, 0.235226, 0.000000, 0.000000,
0.325000, 0.077804, 0.000000, 0.000000,
0.350000, 0.075351, 0.000000, 0.000000,
0.375000, 0.000000, 0.000000, 0.000000,
0.400000, 0.000000, 0.000000, 0.000000,
0.425000, 0.000000, 0.000000, 0.000000,
0.450000, 0.000000, 0.000000, 0.000000,
0.475000, 0.000000, 0.000000, 0.000000,
0.500000, 0.000000, 0.000000, 0.000000,
0.525000, 0.000000, 0.000000, 0.000000,
0.550000, 0.000000, 0.000000, 0.000000,
0.575000, 0.000000, 0.000000, 0.000000,
0.600000, 0.000000, 0.000000, 0.000000,
0.625000, 0.000000, 0.000000, 0.000000,
0.650000, 0.000000, 0.000000, 0.000000,
0.675000, 0.000000, 0.000000, 0.000000,
0.700000, 0.000000, 0.000000, 0.000000,
0.725000, 0.000000, 0.000000, 0.000000,
0.750000, 0.000000, 0.000000, 0.000000,
0.775000, 0.000000, 0.000000, 0.000000,
0.800000, 0.000000, 0.000000, 0.000000,
0.825000, 0.000000, 0.000000, 0.000000,
0.850000, 0.000000, 0.000000, 0.000000,
0.875000, 0.000000, 0.000000, 0.000000,
0.900000, 0.000000, 0.000000, 0.000000,
0.925000, 0.000000, 0.000000, 0.000000,
0.950000, 0.000000, 0.000000, 0.000000,
0.975000, 0.000000, 0.000000, 0.000000,
1.000000, 0.000000, 0.000000, 0.000000, ]).reshape(-1, 4)
eval_at_40points()
eval_at_11points()