mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-20 13:33:24 -07:00
Merge commit '62f1d57871
' into merge-from-upstream/2021-06-02
# Conflicts: # README.md
This commit is contained in:
commit
68552d3b7a
6 changed files with 35 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
||||||
[](https://www.patreon.com/bePatron?u=22997465)
|
[](https://www.patreon.com/bePatron?u=22997465)
|
||||||
|
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
### [View most recent changes](CHANGELOG.md)
|
### [View most recent changes](CHANGELOG.md)
|
||||||
|
@ -36,8 +36,8 @@ More than 95% of deepfake videos are created with DeepFaceLab.
|
||||||
|
|
||||||
DeepFaceLab is used by such popular youtube channels as
|
DeepFaceLab is used by such popular youtube channels as
|
||||||
|
|
||||||
| [deeptomcruise](https://www.tiktok.com/@deeptomcruise)|
|
| [deeptomcruise](https://www.tiktok.com/@deeptomcruise)| [1facerussia](https://www.tiktok.com/@1facerussia)| [arnoldschwarzneggar](https://www.tiktok.com/@arnoldschwarzneggar)
|
||||||
|---|
|
|---|---|---|
|
||||||
|
|
||||||
| [Ctrl Shift Face](https://www.youtube.com/channel/UCKpH0CKltc73e4wh0_pgL3g)| [VFXChris Ume](https://www.youtube.com/channel/UCGf4OlX_aTt8DlrgiH3jN3g/videos)| [Sham00k](https://www.youtube.com/channel/UCZXbWcv7fSZFTAZV4beckyw/videos)|
|
| [Ctrl Shift Face](https://www.youtube.com/channel/UCKpH0CKltc73e4wh0_pgL3g)| [VFXChris Ume](https://www.youtube.com/channel/UCGf4OlX_aTt8DlrgiH3jN3g/videos)| [Sham00k](https://www.youtube.com/channel/UCZXbWcv7fSZFTAZV4beckyw/videos)|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
@ -201,7 +201,7 @@ Unfortunately, there is no "make everything ok" button in DeepFaceLab. You shoul
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td align="right">
|
<tr><td align="right">
|
||||||
<a href="https://tinyurl.com/87vwbtr4">Windows (magnet link)</a>
|
<a href="https://tinyurl.com/4tb2tn4w">Windows (magnet link)</a>
|
||||||
</td><td align="center">Last release. Use torrent client to download.</td></tr>
|
</td><td align="center">Last release. Use torrent client to download.</td></tr>
|
||||||
|
|
||||||
<tr><td align="right">
|
<tr><td align="right">
|
||||||
|
|
|
@ -23,28 +23,13 @@ class Conv2D(nn.LayerBase):
|
||||||
if padding == "SAME":
|
if padding == "SAME":
|
||||||
padding = ( (kernel_size - 1) * dilations + 1 ) // 2
|
padding = ( (kernel_size - 1) * dilations + 1 ) // 2
|
||||||
elif padding == "VALID":
|
elif padding == "VALID":
|
||||||
padding = 0
|
padding = None
|
||||||
else:
|
else:
|
||||||
raise ValueError ("Wrong padding type. Should be VALID SAME or INT or 4x INTs")
|
raise ValueError ("Wrong padding type. Should be VALID SAME or INT or 4x INTs")
|
||||||
|
|
||||||
if isinstance(padding, int):
|
|
||||||
if padding != 0:
|
|
||||||
if nn.data_format == "NHWC":
|
|
||||||
padding = [ [0,0], [padding,padding], [padding,padding], [0,0] ]
|
|
||||||
else:
|
|
||||||
padding = [ [0,0], [0,0], [padding,padding], [padding,padding] ]
|
|
||||||
else:
|
|
||||||
padding = None
|
|
||||||
|
|
||||||
if nn.data_format == "NHWC":
|
|
||||||
strides = [1,strides,strides,1]
|
|
||||||
else:
|
else:
|
||||||
strides = [1,1,strides,strides]
|
padding = int(padding)
|
||||||
|
|
||||||
|
|
||||||
if nn.data_format == "NHWC":
|
|
||||||
dilations = [1,dilations,dilations,1]
|
|
||||||
else:
|
|
||||||
dilations = [1,1,dilations,dilations]
|
|
||||||
|
|
||||||
self.in_ch = in_ch
|
self.in_ch = in_ch
|
||||||
self.out_ch = out_ch
|
self.out_ch = out_ch
|
||||||
|
@ -93,10 +78,27 @@ class Conv2D(nn.LayerBase):
|
||||||
if self.use_wscale:
|
if self.use_wscale:
|
||||||
weight = weight * self.wscale
|
weight = weight * self.wscale
|
||||||
|
|
||||||
if self.padding is not None:
|
padding = self.padding
|
||||||
x = tf.pad (x, self.padding, mode='CONSTANT')
|
if padding is not None:
|
||||||
|
if nn.data_format == "NHWC":
|
||||||
|
padding = [ [0,0], [padding,padding], [padding,padding], [0,0] ]
|
||||||
|
else:
|
||||||
|
padding = [ [0,0], [0,0], [padding,padding], [padding,padding] ]
|
||||||
|
x = tf.pad (x, padding, mode='CONSTANT')
|
||||||
|
|
||||||
x = tf.nn.conv2d(x, weight, self.strides, 'VALID', dilations=self.dilations, data_format=nn.data_format)
|
strides = self.strides
|
||||||
|
if nn.data_format == "NHWC":
|
||||||
|
strides = [1,strides,strides,1]
|
||||||
|
else:
|
||||||
|
strides = [1,1,strides,strides]
|
||||||
|
|
||||||
|
dilations = self.dilations
|
||||||
|
if nn.data_format == "NHWC":
|
||||||
|
dilations = [1,dilations,dilations,1]
|
||||||
|
else:
|
||||||
|
dilations = [1,1,dilations,dilations]
|
||||||
|
|
||||||
|
x = tf.nn.conv2d(x, weight, strides, 'VALID', dilations=dilations, data_format=nn.data_format)
|
||||||
if self.use_bias:
|
if self.use_bias:
|
||||||
if nn.data_format == "NHWC":
|
if nn.data_format == "NHWC":
|
||||||
bias = tf.reshape (self.bias, (1,1,1,self.out_ch) )
|
bias = tf.reshape (self.bias, (1,1,1,self.out_ch) )
|
||||||
|
|
|
@ -57,7 +57,9 @@ def MergeMaskedFace (predictor_func, predictor_input_shape,
|
||||||
prd_face_mask_a_0 = cv2.resize (prd_face_mask_a_0, (output_size, output_size), interpolation=cv2.INTER_CUBIC)
|
prd_face_mask_a_0 = cv2.resize (prd_face_mask_a_0, (output_size, output_size), interpolation=cv2.INTER_CUBIC)
|
||||||
prd_face_dst_mask_a_0 = cv2.resize (prd_face_dst_mask_a_0, (output_size, output_size), interpolation=cv2.INTER_CUBIC)
|
prd_face_dst_mask_a_0 = cv2.resize (prd_face_dst_mask_a_0, (output_size, output_size), interpolation=cv2.INTER_CUBIC)
|
||||||
|
|
||||||
if cfg.mask_mode == 1: #dst
|
if cfg.mask_mode == 0: #full
|
||||||
|
wrk_face_mask_a_0 = np.ones_like(dst_face_mask_a_0)
|
||||||
|
elif cfg.mask_mode == 1: #dst
|
||||||
wrk_face_mask_a_0 = cv2.resize (dst_face_mask_a_0, (output_size,output_size), interpolation=cv2.INTER_CUBIC)
|
wrk_face_mask_a_0 = cv2.resize (dst_face_mask_a_0, (output_size,output_size), interpolation=cv2.INTER_CUBIC)
|
||||||
elif cfg.mask_mode == 2: #learned-prd
|
elif cfg.mask_mode == 2: #learned-prd
|
||||||
wrk_face_mask_a_0 = prd_face_mask_a_0
|
wrk_face_mask_a_0 = prd_face_mask_a_0
|
||||||
|
|
|
@ -81,7 +81,8 @@ mode_dict = {0:'original',
|
||||||
|
|
||||||
mode_str_dict = { mode_dict[key] : key for key in mode_dict.keys() }
|
mode_str_dict = { mode_dict[key] : key for key in mode_dict.keys() }
|
||||||
|
|
||||||
mask_mode_dict = {1:'dst',
|
mask_mode_dict = {0:'full',
|
||||||
|
1:'dst',
|
||||||
2:'learned-prd',
|
2:'learned-prd',
|
||||||
3:'learned-dst',
|
3:'learned-dst',
|
||||||
4:'learned-prd*learned-dst',
|
4:'learned-prd*learned-dst',
|
||||||
|
|
|
@ -586,7 +586,7 @@ class AMPModel(ModelBase):
|
||||||
gpu_src_dst_code = tf.concat( ( tf.slice(gpu_dst_inter_src_code, [0,0,0,0], [-1, ae_dims_slice , lowest_dense_res, lowest_dense_res]),
|
gpu_src_dst_code = tf.concat( ( tf.slice(gpu_dst_inter_src_code, [0,0,0,0], [-1, ae_dims_slice , lowest_dense_res, lowest_dense_res]),
|
||||||
tf.slice(gpu_dst_inter_dst_code, [0,ae_dims_slice,0,0], [-1,ae_dims-ae_dims_slice, lowest_dense_res,lowest_dense_res]) ), 1 )
|
tf.slice(gpu_dst_inter_dst_code, [0,ae_dims_slice,0,0], [-1,ae_dims-ae_dims_slice, lowest_dense_res,lowest_dense_res]) ), 1 )
|
||||||
|
|
||||||
gpu_pred_src_dst, gpu_pred_src_dstm = self.decoder(gpu_dst_inter_src_code)
|
gpu_pred_src_dst, gpu_pred_src_dstm = self.decoder(gpu_src_dst_code)
|
||||||
_, gpu_pred_dst_dstm = self.decoder(gpu_dst_inter_dst_code)
|
_, gpu_pred_dst_dstm = self.decoder(gpu_dst_inter_dst_code)
|
||||||
|
|
||||||
def AE_merge(warped_dst, morph_value):
|
def AE_merge(warped_dst, morph_value):
|
||||||
|
|
|
@ -23,7 +23,7 @@ class SampleLoader:
|
||||||
try:
|
try:
|
||||||
samples = samplelib.PackedFaceset.load(samples_path)
|
samples = samplelib.PackedFaceset.load(samples_path)
|
||||||
except:
|
except:
|
||||||
io.log_err(f"Error occured while loading samplelib.PackedFaceset.load {str(samples_dat_path)}, {traceback.format_exc()}")
|
io.log_err(f"Error occured while loading samplelib.PackedFaceset.load {str(samples_path)}, {traceback.format_exc()}")
|
||||||
|
|
||||||
if samples is None:
|
if samples is None:
|
||||||
raise ValueError("packed faceset not found.")
|
raise ValueError("packed faceset not found.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue