.
This commit is contained in:
@@ -12,4 +12,5 @@ from .FRNorm2D import *
|
|||||||
|
|
||||||
from .TLU import *
|
from .TLU import *
|
||||||
from .ScaleAdd import *
|
from .ScaleAdd import *
|
||||||
from .DenseNorm import *
|
from .DenseNorm import *
|
||||||
|
from .AdaIN import *
|
||||||
@@ -447,13 +447,12 @@ class FinalLoaderSubprocessor(Subprocessor):
|
|||||||
raise Exception ("Unable to load %s" % (filepath.name) )
|
raise Exception ("Unable to load %s" % (filepath.name) )
|
||||||
|
|
||||||
gray = cv2.cvtColor(bgr, cv2.COLOR_BGR2GRAY)
|
gray = cv2.cvtColor(bgr, cv2.COLOR_BGR2GRAY)
|
||||||
|
|
||||||
if self.faster:
|
if self.faster:
|
||||||
source_rect = dflimg.get_source_rect()
|
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))
|
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:
|
else:
|
||||||
face_mask = LandmarksProcessor.get_image_hull_mask (gray.shape, dflimg.get_landmarks())
|
face_mask = LandmarksProcessor.get_image_hull_mask (gray.shape, dflimg.get_landmarks())
|
||||||
sharpness = estimate_sharpness( (gray*face_mask).astype(np.uint8) )
|
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] )
|
pitch, yaw, roll = LandmarksProcessor.estimate_pitch_yaw_roll ( dflimg.get_landmarks(), size=dflimg.get_shape()[1] )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user