mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -07:00
.
This commit is contained in:
parent
bb8d2b5b2c
commit
b6dd482e05
2 changed files with 4 additions and 4 deletions
|
@ -13,3 +13,4 @@ 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] )
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue