init
Browse files
app.py
CHANGED
@@ -153,24 +153,24 @@ def run(
|
|
153 |
lmfile68 = os.path.join(opt.lm_dir, name + '_68.txt')
|
154 |
|
155 |
# 预处理数据
|
156 |
-
|
157 |
-
f = open(lmfile68, 'w')
|
158 |
-
print(landmarks_str, file=f)
|
159 |
-
f.close()
|
160 |
-
landmarks = np.loadtxt(lmfile68, dtype=np.int64)
|
161 |
-
|
162 |
-
ff = open(lmfile5, 'w')
|
163 |
-
lm = (landmarks[36] + landmarks[39]) / 2
|
164 |
-
print(int(lm[0]), int(lm[1]), file=ff)
|
165 |
-
lm = (landmarks[45] + landmarks[42]) / 2
|
166 |
-
print(int(lm[0]), int(lm[1]), file=ff)
|
167 |
-
lm = landmarks[30]
|
168 |
-
print(lm[0], lm[1], file=ff)
|
169 |
-
lm = landmarks[48]
|
170 |
-
print(lm[0], lm[1], file=ff)
|
171 |
-
lm = landmarks[54]
|
172 |
-
print(lm[0], lm[1], file=ff)
|
173 |
-
ff.close()
|
174 |
|
175 |
imgs = []
|
176 |
for part in ['eyel', 'eyer', 'nose', 'mouth']:
|
|
|
153 |
lmfile68 = os.path.join(opt.lm_dir, name + '_68.txt')
|
154 |
|
155 |
# 预处理数据
|
156 |
+
get_68lm(imgfile, lmfile5, lmfile68, detector, predictor)
|
157 |
+
# f = open(lmfile68, 'w')
|
158 |
+
# print(landmarks_str, file=f)
|
159 |
+
# f.close()
|
160 |
+
# landmarks = np.loadtxt(lmfile68, dtype=np.int64)
|
161 |
+
#
|
162 |
+
# ff = open(lmfile5, 'w')
|
163 |
+
# lm = (landmarks[36] + landmarks[39]) / 2
|
164 |
+
# print(int(lm[0]), int(lm[1]), file=ff)
|
165 |
+
# lm = (landmarks[45] + landmarks[42]) / 2
|
166 |
+
# print(int(lm[0]), int(lm[1]), file=ff)
|
167 |
+
# lm = landmarks[30]
|
168 |
+
# print(lm[0], lm[1], file=ff)
|
169 |
+
# lm = landmarks[48]
|
170 |
+
# print(lm[0], lm[1], file=ff)
|
171 |
+
# lm = landmarks[54]
|
172 |
+
# print(lm[0], lm[1], file=ff)
|
173 |
+
# ff.close()
|
174 |
|
175 |
imgs = []
|
176 |
for part in ['eyel', 'eyer', 'nose', 'mouth']:
|