mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -07:00
fix
This commit is contained in:
parent
4ed320a86b
commit
addc96fe3e
1 changed files with 16 additions and 9 deletions
|
@ -1,13 +1,15 @@
|
||||||
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from core import imagelib
|
from core import imagelib
|
||||||
from facelib import FaceType, LandmarksProcessor
|
|
||||||
from core.interact import interact as io
|
|
||||||
from core.cv2ex import *
|
from core.cv2ex import *
|
||||||
|
from core.interact import interact as io
|
||||||
|
from facelib import FaceType, LandmarksProcessor
|
||||||
|
|
||||||
|
is_windows = sys.platform[0:3] == 'win'
|
||||||
xseg_input_size = 256
|
xseg_input_size = 256
|
||||||
|
|
||||||
def MergeMaskedFace (predictor_func, predictor_input_shape,
|
def MergeMaskedFace (predictor_func, predictor_input_shape,
|
||||||
|
@ -232,10 +234,15 @@ def MergeMaskedFace (predictor_func, predictor_input_shape,
|
||||||
|
|
||||||
cfg_mp = cfg.motion_blur_power / 100.0
|
cfg_mp = cfg.motion_blur_power / 100.0
|
||||||
|
|
||||||
|
if not is_windows:
|
||||||
# linux opencv can produce nan's so there will be errors in multiplying and glitches in videos
|
# linux opencv can produce nan's so there will be errors in multiplying and glitches in videos
|
||||||
img_bgr = np.nan_to_num(img_bgr)
|
img_bgr = np.nan_to_num(img_bgr)
|
||||||
|
|
||||||
img_face_mask_a = np.nan_to_num(img_face_mask_a)
|
img_face_mask_a = np.nan_to_num(img_face_mask_a)
|
||||||
|
|
||||||
|
if not is_windows:
|
||||||
out_img = np.nan_to_num(out_img)
|
out_img = np.nan_to_num(out_img)
|
||||||
|
|
||||||
out_img = img_bgr*(1-img_face_mask_a) + (out_img*img_face_mask_a)
|
out_img = img_bgr*(1-img_face_mask_a) + (out_img*img_face_mask_a)
|
||||||
|
|
||||||
if ('seamless' in cfg.mode and cfg.color_transfer_mode != 0) or \
|
if ('seamless' in cfg.mode and cfg.color_transfer_mode != 0) or \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue