mirror of
https://github.com/deepinsight/insightface.git
synced 2026-07-15 00:57:48 +00:00
fix align template while inputsize divided by 128
This commit is contained in:
@@ -11,7 +11,7 @@ except ImportError:
|
||||
"Unable to import dependency onnxruntime. "
|
||||
)
|
||||
|
||||
__version__ = '0.7.1'
|
||||
__version__ = '0.7.2'
|
||||
|
||||
from . import model_zoo
|
||||
from . import utils
|
||||
|
||||
@@ -13,9 +13,12 @@ def estimate_norm(lmk, image_size=112,mode='arcface'):
|
||||
assert image_size%112==0 or image_size%128==0
|
||||
if image_size%112==0:
|
||||
ratio = float(image_size)/112.0
|
||||
diff_x = 0
|
||||
else:
|
||||
ratio = float(image_size)/128.0
|
||||
diff_x = 8.0*ratio
|
||||
dst = arcface_dst * ratio
|
||||
dst[:,0] += diff_x
|
||||
tform = trans.SimilarityTransform()
|
||||
tform.estimate(lmk, dst)
|
||||
M = tform.params[0:2, :]
|
||||
|
||||
Reference in New Issue
Block a user