python package

This commit is contained in:
nttstar
2019-12-17 11:00:32 +08:00
parent 4a4b8d03fe
commit 947e0854e4
3 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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, :]

View File

@@ -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',