This commit is contained in:
Colombo 2020-06-27 19:08:14 +04:00
parent bb8d2b5b2c
commit b6dd482e05
2 changed files with 4 additions and 4 deletions

View file

@ -12,4 +12,5 @@ from .FRNorm2D import *
from .TLU import *
from .ScaleAdd import *
from .DenseNorm import *
from .DenseNorm import *
from .AdaIN import *

View file

@ -447,13 +447,12 @@ class FinalLoaderSubprocessor(Subprocessor):
raise Exception ("Unable to load %s" % (filepath.name) )
gray = cv2.cvtColor(bgr, cv2.COLOR_BGR2GRAY)
if self.faster:
source_rect = dflimg.get_source_rect()
sharpness = mathlib.polygon_area(np.array(source_rect[[0,2,2,0]]).astype(np.float32), np.array(source_rect[[1,1,3,3]]).astype(np.float32))
else:
face_mask = LandmarksProcessor.get_image_hull_mask (gray.shape, dflimg.get_landmarks())
sharpness = estimate_sharpness( (gray*face_mask).astype(np.uint8) )
face_mask = LandmarksProcessor.get_image_hull_mask (gray.shape, dflimg.get_landmarks())
sharpness = estimate_sharpness( (gray[...,None]*face_mask).astype(np.uint8) )
pitch, yaw, roll = LandmarksProcessor.estimate_pitch_yaw_roll ( dflimg.get_landmarks(), size=dflimg.get_shape()[1] )