-
Notifications
You must be signed in to change notification settings - Fork 0
/
testcase1_split_sumerror.py
200 lines (165 loc) · 5.18 KB
/
testcase1_split_sumerror.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import testcase_split_crop
import matplotlib.pyplot as plt
import pylab
#First element=model
#Second element= input
#Third element= match(1) or not(0)
dataset_torso = [
["jochen_foto9", "nina1", 0],
["jochen_foto9", "emma1", 0],
["gil1", "emma1", 0],
["gil1", "emma1", 0],
["jochen_foto1", "emma1", 0],
["jochen_foto2", "emma1", 0],
["gil1", "emma1", 0],
["foto1", "foto2", 1],
["foto1", "foto6", 1],
["foto6", "foto2", 1],
["foto1", "jochen_foto1", 1],
["foto1", "jochen_foto2", 1],
["jochen_foto1", "foto2", 1],
["jochen_foto2", "foto2", 1],
["foto6", "jochen_foto1", 1],
["foto6", "jochen_foto2", 1],
["jochen_foto4", "jochen_foto9", 1],
["jochen_foto1", "jochen_foto2", 1],
["jochen_foto5", "jochen_foto6", 1],
["jochen_foto8", "jochen_foto7", 1], #tot hier matches
["foto5", "jochen_foto2", 0],
["foto5", "jochen_foto1", 0],
["foto5", "jochen_foto7", 0],
["foto3", "jochen_foto4", 0],
["foto3", "jochen_foto5", 0],
["foto3", "jochen_foto7", 0],
["jochen_foto6", "jochen_foto7", 0],
["foto5", "foto6", 0],
["foto5", "foto8", 0],
["foto5", "foto4", 0],
["foto5", "foto3", 0],
["foto5", "foto2", 0],
["foto5", "foto1", 0],
["foto7", "foto1", 0],
["foto7", "foto2", 0],
["foto7", "foto3", 0],
["foto7", "foto4", 0],
["mama1", "jochen_foto6", 0],
["mama1", "jochen_foto9", 0],
["mama1", "jochen_foto5", 0],
["mama1", "jochen_foto4", 0],
["mama1", "jochen_foto2", 0],
["mama1", "jochen_foto1", 0],
["mama2", "jochen_foto1", 0],
["mama2", "jochen_foto2", 0],
["mama2", "jochen_foto4", 0],
["mama2", "jochen_foto7", 0],
["mama2", "jochen_foto8", 0],
["mama2", "jochen_foto6", 0],#twijfel gevalleke
["mama1", "jochen_foto7", 0],
]
dataset_legs = [
["foto1", "jochen_foto1", 1],
["foto1", "foto2", 1],
["jochen_foto9", "nina1", 0],
["jochen_foto4", "nina1", 0],
["jochen_foto6", "jochen_foto7", 1],
["jochen_foto6", "jochen_foto8", 1],
["jochen_foto8", "jochen_foto7", 1],
["jochen_foto6", "jochen_foto5", 1],
["jochen_foto5", "jochen_foto7", 1],
["jochen_foto1", "jochen_foto2", 1],
["jochen_foto1", "foto7", 1],
["jochen_foto2", "foto7", 1],
["foto5", "foto7", 1],
["foto1", "jochen_foto9", 0],
["foto3", "jochen_foto9", 0],
["foto3", "foto1", 0],
["foto3", "foto2", 0],
["foto3", "foto4", 0],
["foto3", "foto5", 0],
]
dataset_face = [
["foto1", "foto2", 1],
["foto1", "foto3", 1],
["foto1", "foto5", 1],
["foto5", "foto3", 1],
["foto1", "foto2", 1],
["foto1", "foto4", 0],
["foto5", "foto4", 0],
["foto3", "foto4", 0],
["foto2", "foto4", 0],
]
#####################
#plotjes maken van euclMax error en SUM(eucld errors)
#####################""
class Match_result:
def __init__(self, eucl_max, sum_eucl, match):
self.eucl_max = eucl_max
self.sum_eucl = sum_eucl
self.match = match
result_set_face = []
result_set_torso = []
result_set_legs = []
for pose_set in dataset_torso:
result = testcase_split_crop.calc_match(pose_set[0], pose_set[1])
#In result array zitten results van de 3 splits
# eerst face => [0]
# dan torso => [1]
# dan legs => [2]
rotation = result[1][1]
maxEucl = result[1][0]
sumEucl = result[1][2]
match_or_not = pose_set[2]
result_set_torso.append(Match_result(maxEucl, sumEucl, match_or_not))
for pose_set in dataset_legs:
result = testcase_split_crop.calc_match(pose_set[0], pose_set[1])
result_set_legs.append(Match_result(result[2][0], result[2][2], pose_set[2]))
for pose_set in dataset_face:
result = testcase_split_crop.calc_match(pose_set[0], pose_set[1])
result_set_face.append(Match_result(result[0][0], result[0][1], pose_set[2]))
#result_set_torso.append(Match_result(result[1][0], result[1][1], pose_set[2]))
#result_set_legs.append(Match_result(result[2][0], result[2][1], pose_set[2]))
fig, ax = plt.subplots()
ax.set_title("Torso")
ax.set_xlabel('MAX RMS')
ax.set_ylabel('SUM')
#ax.plot((0, 0.05), (30, 30), 'g')
#ax.plot((0.05, 0.05), (0, 30), 'k-')
counter = 0
for x in result_set_torso:
#MATCH
if x.match == 1:
ax.scatter(x.eucl_max, x.sum_eucl, c='b') #sum_eucl is rotation in dit geval ..
#N0 MATCH
else:
ax.scatter(x.eucl_max, x.sum_eucl, c='r')
ax.annotate(counter, (x.eucl_max, x.sum_eucl), fontsize=8)
counter = counter+1
fig, ax = plt.subplots()
ax.set_title("Legs")
ax.set_xlabel('MAX RMS')
ax.set_ylabel('SUM')
counter = 0
for x in result_set_legs:
#MATCH
if x.match == 1:
ax.scatter(x.eucl_max, x.sum_eucl, c='b')
#N0 MATCH
else:
ax.scatter(x.eucl_max, x.sum_eucl, c='r')
ax.annotate(counter, (x.eucl_max, x.sum_eucl), fontsize=8)
counter = counter+1
fig, ax = plt.subplots()
ax.set_title("Face")
ax.set_xlabel('MAX RMS')
ax.set_ylabel('Rotation')
counter = 0
for x in result_set_face:
#MATCH
if x.match == 1:
ax.scatter(x.eucl_max, x.sum_eucl, c='b')
#N0 MATCH
else:
ax.scatter(x.eucl_max, x.sum_eucl, c='r')
ax.annotate(counter, (x.eucl_max, x.sum_eucl), fontsize=8)
counter = counter+1
plt.show()