From 32ad1af3c7102d1254493c9f5b6d1409a16f627b Mon Sep 17 00:00:00 2001 From: Abdolkarim Saeedi Date: Tue, 26 May 2020 12:38:19 +0430 Subject: [PATCH 1/2] fixed some errors and added comments. Right now norms can't be calculated due to src having extended dims, fixed the issue on that. Also added comment for left profile face, which was missing. --- python-package/insightface/utils/face_align.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python-package/insightface/utils/face_align.py b/python-package/insightface/utils/face_align.py index 6cf5a2e64..817cf2488 100644 --- a/python-package/insightface/utils/face_align.py +++ b/python-package/insightface/utils/face_align.py @@ -3,6 +3,7 @@ import numpy as np from skimage import transform as trans +#<--left profile src1 = np.array([ [51.642,50.115], [57.617,49.990], @@ -68,6 +69,7 @@ def estimate_norm(lmk, image_size = 112, mode='arcface'): src = arcface_src else: src = src_map[image_size] + src.reshape(-1, 5, 2) for i in np.arange(src.shape[0]): tform.estimate(lmk, src[i]) M = tform.params[0:2,:] From 7c997b4030eb1e1f046a99c7e25b5e309022c9f1 Mon Sep 17 00:00:00 2001 From: Abdolkarim Saeedi Date: Tue, 26 May 2020 12:48:38 +0430 Subject: [PATCH 2/2] Update face_align.py --- python-package/insightface/utils/face_align.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python-package/insightface/utils/face_align.py b/python-package/insightface/utils/face_align.py index 817cf2488..607f9f4f6 100644 --- a/python-package/insightface/utils/face_align.py +++ b/python-package/insightface/utils/face_align.py @@ -69,7 +69,6 @@ def estimate_norm(lmk, image_size = 112, mode='arcface'): src = arcface_src else: src = src_map[image_size] - src.reshape(-1, 5, 2) for i in np.arange(src.shape[0]): tform.estimate(lmk, src[i]) M = tform.params[0:2,:]