@@ -281,15 +281,15 @@ def get_transform_mat (image_landmarks, output_size, face_type, scale=1.0):
281
281
282
282
# calc 3 points in global space to estimate 2d affine transform
283
283
if not remove_align :
284
- l_t = np .array ( [ np . round ( g_c - tb_diag_vec * mod ) ,
285
- np . round ( g_c + bt_diag_vec * mod ) ,
286
- np . round ( g_c + tb_diag_vec * mod ) ] )
284
+ l_t = np .array ( [ g_c - tb_diag_vec * mod ,
285
+ g_c + bt_diag_vec * mod ,
286
+ g_c + tb_diag_vec * mod ] )
287
287
else :
288
288
# remove_align - face will be centered in the frame but not aligned
289
- l_t = np .array ( [ np . round ( g_c - tb_diag_vec * mod ) ,
290
- np . round ( g_c + bt_diag_vec * mod ) ,
291
- np . round ( g_c + tb_diag_vec * mod ) ,
292
- np . round ( g_c - bt_diag_vec * mod ) ,
289
+ l_t = np .array ( [ g_c - tb_diag_vec * mod ,
290
+ g_c + bt_diag_vec * mod ,
291
+ g_c + tb_diag_vec * mod ,
292
+ g_c - bt_diag_vec * mod ,
293
293
] )
294
294
295
295
# get area of face square in global space
@@ -299,9 +299,9 @@ def get_transform_mat (image_landmarks, output_size, face_type, scale=1.0):
299
299
side = np .float32 (math .sqrt (area ) / 2 )
300
300
301
301
# calc 3 points with unrotated square
302
- l_t = np .array ( [ np . round ( g_c + [- side ,- side ] ) ,
303
- np . round ( g_c + [ side ,- side ] ) ,
304
- np . round ( g_c + [ side , side ] ) ] )
302
+ l_t = np .array ( [ g_c + [- side ,- side ],
303
+ g_c + [ side ,- side ],
304
+ g_c + [ side , side ] ] )
305
305
306
306
# calc affine transform from 3 global space points to 3 local space points size of 'output_size'
307
307
pts2 = np .float32 (( (0 ,0 ),(output_size ,0 ),(output_size ,output_size ) ))
0 commit comments