Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 9b070e1

Browse files
committed
fixed face jitter
1 parent 8a62242 commit 9b070e1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

facelib/LandmarksProcessor.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,15 @@ def get_transform_mat (image_landmarks, output_size, face_type, scale=1.0):
281281

282282
# calc 3 points in global space to estimate 2d affine transform
283283
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 ] )
287287
else:
288288
# 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,
293293
] )
294294

295295
# 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):
299299
side = np.float32(math.sqrt(area) / 2)
300300

301301
# 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] ] )
305305

306306
# calc affine transform from 3 global space points to 3 local space points size of 'output_size'
307307
pts2 = np.float32(( (0,0),(output_size,0),(output_size,output_size) ))

0 commit comments

Comments
 (0)