mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 07:37:03 -07:00
1
This commit is contained in:
parent
0c93b89e87
commit
60804ca3ba
3 changed files with 20 additions and 15 deletions
|
@ -76,15 +76,19 @@ class nn():
|
|||
|
||||
first_run = False
|
||||
|
||||
if sys.platform[0:3] == 'win':
|
||||
devices_str = ""
|
||||
for device in device_config.devices:
|
||||
devices_str += "_" + device.name.replace(' ','_')
|
||||
if not device_config.cpu_only:
|
||||
if sys.platform[0:3] == 'win':
|
||||
if all( [ x.name == device_config.devices[0].name for x in device_config.devices ] ):
|
||||
devices_str = "_" + device_config.devices[0].name.replace(' ','_')
|
||||
else:
|
||||
devices_str = ""
|
||||
for device in device_config.devices:
|
||||
devices_str += "_" + device.name.replace(' ','_')
|
||||
|
||||
compute_cache_path = Path(os.environ['APPDATA']) / 'NVIDIA' / ('ComputeCache' + devices_str)
|
||||
if not compute_cache_path.exists():
|
||||
first_run = True
|
||||
os.environ['CUDA_CACHE_PATH'] = str(compute_cache_path)
|
||||
compute_cache_path = Path(os.environ['APPDATA']) / 'NVIDIA' / ('ComputeCache' + devices_str)
|
||||
if not compute_cache_path.exists():
|
||||
first_run = True
|
||||
os.environ['CUDA_CACHE_PATH'] = str(compute_cache_path)
|
||||
|
||||
os.environ['TF_MIN_GPU_MULTIPROCESSOR_COUNT'] = '2'
|
||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # tf log errors only
|
||||
|
|
|
@ -156,6 +156,8 @@ class ExtractSubprocessor(Subprocessor):
|
|||
landmarks_extractor,
|
||||
rects_extractor,
|
||||
):
|
||||
h, w, ch = image.shape
|
||||
|
||||
if data.rects_rotation == 0:
|
||||
rotated_image = image
|
||||
elif data.rects_rotation == 90:
|
||||
|
|
|
@ -615,9 +615,9 @@ class SAEHDModel(ModelBase):
|
|||
with tf.device( f'/GPU:0' if len(devices) != 0 else f'/CPU:0'):
|
||||
if 'df' in archi:
|
||||
gpu_dst_code = self.inter(self.encoder(self.warped_dst))
|
||||
gpu_pred_src_dst = self.decoder_src(gpu_dst_code)
|
||||
gpu_pred_dst_dstm = self.decoder_dstm(gpu_dst_code)
|
||||
gpu_pred_src_dstm = self.decoder_srcm(gpu_dst_code)
|
||||
gpu_pred_src_dst, gpu_pred_src_dstm = self.decoder_src(gpu_dst_code)
|
||||
_, gpu_pred_dst_dstm = self.decoder_dst(gpu_dst_code)
|
||||
|
||||
elif 'liae' in archi:
|
||||
gpu_dst_code = self.encoder (self.warped_dst)
|
||||
gpu_dst_inter_B_code = self.inter_B (gpu_dst_code)
|
||||
|
@ -625,9 +625,8 @@ class SAEHDModel(ModelBase):
|
|||
gpu_dst_code = tf.concat([gpu_dst_inter_B_code,gpu_dst_inter_AB_code],-1)
|
||||
gpu_src_dst_code = tf.concat([gpu_dst_inter_AB_code,gpu_dst_inter_AB_code],-1)
|
||||
|
||||
gpu_pred_src_dst = self.decoder(gpu_src_dst_code)
|
||||
gpu_pred_dst_dstm = self.decoderm(gpu_dst_code)
|
||||
gpu_pred_src_dstm = self.decoderm(gpu_src_dst_code)
|
||||
gpu_pred_src_dst, gpu_pred_src_dstm = self.decoder(gpu_src_dst_code)
|
||||
_, gpu_pred_dst_dstm = self.decoder(gpu_dst_code)
|
||||
|
||||
if learn_mask:
|
||||
def AE_merge( warped_dst):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue