mirror of
https://github.com/deepinsight/insightface.git
synced 2025-12-30 08:02:27 +00:00
python package
This commit is contained in:
@@ -20,7 +20,7 @@ except ImportError:
|
||||
"Unable to import dependency mxnet. "
|
||||
"A quick tip is to install via `pip install mxnet-mkl/mxnet-cu90mkl --pre`. ")
|
||||
|
||||
__version__ = '0.1.3'
|
||||
__version__ = '0.1.5'
|
||||
|
||||
from . import model_zoo
|
||||
from . import utils
|
||||
|
||||
@@ -44,7 +44,8 @@ class FaceAnalysis:
|
||||
img_center = img.shape[0]//2, img.shape[1]//2
|
||||
offsets = np.vstack([ (bboxes[:,0]+bboxes[:,2])/2-img_center[1], (bboxes[:,1]+bboxes[:,3])/2-img_center[0] ])
|
||||
offset_dist_squared = np.sum(np.power(offsets,2.0),0)
|
||||
bindex = np.argmax(area-offset_dist_squared*2.0) # some extra weight on the centering
|
||||
values = area-offset_dist_squared*2.0 # some extra weight on the centering
|
||||
bindex = np.argsort(values)[::-1] # some extra weight on the centering
|
||||
bindex = bindex[0:max_num]
|
||||
bboxes = bboxes[bindex, :]
|
||||
landmarks = landmarks[bindex, :]
|
||||
|
||||
@@ -2,6 +2,7 @@ from __future__ import division
|
||||
import mxnet as mx
|
||||
import numpy as np
|
||||
import mxnet.ndarray as nd
|
||||
import cv2
|
||||
|
||||
__all__ = ['FaceDetector',
|
||||
'retinaface_r50_v1',
|
||||
|
||||
Reference in New Issue
Block a user