mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-20 21:43:21 -07:00
manual extractor: increased FPS,
sort by final : now you can specify target number of images, converter: fix seamless mask and exception, huge refactoring
This commit is contained in:
parent
7db469a1da
commit
438213e97c
30 changed files with 1834 additions and 1718 deletions
|
@ -3,10 +3,6 @@ import os
|
|||
import cv2
|
||||
from pathlib import Path
|
||||
|
||||
from utils import std_utils
|
||||
|
||||
|
||||
|
||||
def transform(point, center, scale, resolution):
|
||||
pt = np.array ( [point[0], point[1], 1.0] )
|
||||
h = 200.0 * scale
|
||||
|
@ -123,8 +119,7 @@ class LandmarksExtractor(object):
|
|||
image = crop(input_image, center, scale).transpose ( (2,0,1) ).astype(np.float32) / 255.0
|
||||
image = np.expand_dims(image, 0)
|
||||
|
||||
with std_utils.suppress_stdout_stderr():
|
||||
predicted = self.keras_model.predict (image)
|
||||
predicted = self.keras_model.predict (image)
|
||||
|
||||
pts_img = get_pts_from_predict ( predicted[-1][0], center, scale)
|
||||
pts_img = [ ( int(pt[0]), int(pt[1]) ) for pt in pts_img ]
|
||||
|
|
|
@ -134,7 +134,7 @@ def get_transform_mat (image_landmarks, output_size, face_type, scale=1.0):
|
|||
elif face_type == FaceType.HEAD:
|
||||
padding = (output_size / 64) * 24
|
||||
else:
|
||||
raise ValueError ('wrong face_type')
|
||||
raise ValueError ('wrong face_type: ', face_type)
|
||||
|
||||
mat = umeyama(image_landmarks[17:], landmarks_2D, True)[0:2]
|
||||
mat = mat * (output_size - 2 * padding)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue