mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 14:24:40 -07:00
updated CLI options for converter
This commit is contained in:
parent
5b20bbc7f9
commit
2c1f8f2bf6
2 changed files with 10 additions and 5 deletions
|
@ -8,6 +8,7 @@ import imagelib
|
|||
from facelib import FaceType, FANSegmentator, LandmarksProcessor
|
||||
from interact import interact as io
|
||||
from joblib import SubprocessFunctionCaller
|
||||
from samplelib.SampleProcessor import ColorTransferMode
|
||||
from utils.pickle_utils import AntiPickler
|
||||
|
||||
from .Converter import Converter
|
||||
|
@ -116,8 +117,10 @@ class ConverterMasked(Converter):
|
|||
1.0 + io.input_int("Choose output face scale modifier [-50..50] (skip:0) : ", 0) * 0.01, 0.5, 1.5)
|
||||
|
||||
if self.mode != 'raw':
|
||||
self.color_transfer_mode = io.input_str(
|
||||
"Apply color transfer to predicted face? Choose mode ( rct/lct skip:None ) : ", None, ['rct', 'lct'])
|
||||
self.color_transfer_mode = np.clip(io.input_int(
|
||||
"Apply color transfer to predicted face? (0) None, (1) LCT, (2) RCT, (3) RCT-c, (4) RCT-p, "
|
||||
"(5) RCT-pc, (6) mRTC, (7) mRTC-c, (8) mRTC-p, (9) mRTC-pc ?:help skip:%s) : ", ColorTransferMode.NONE),
|
||||
ColorTransferMode.NONE, ColorTransferMode.MASKED_RCT_PAPER_CLIP)
|
||||
|
||||
self.super_resolution = io.input_bool("Apply super resolution? (y/n ?:help skip:n) : ", False,
|
||||
help_message="Enhance details by applying DCSCN network.")
|
||||
|
|
|
@ -123,13 +123,15 @@ class SAEModel(ModelBase):
|
|||
0.0, 100.0)
|
||||
|
||||
default_apply_random_ct = ColorTransferMode.NONE if is_first_run else self.options.get('apply_random_ct', ColorTransferMode.NONE)
|
||||
self.options['apply_random_ct'] = io.input_int(
|
||||
"Apply random color transfer to src faceset? (0) None, (1) LCT, (2) RCT, (3) RCT-c, (4) RCT-p, (5) RCT-pc, (6) mRTC, (7) mRTC-c, (8) mRTC-p, (9) mRTC-pc ?:help skip:%s) : " % (default_apply_random_ct),
|
||||
self.options['apply_random_ct'] = np.clip(io.input_int(
|
||||
"Apply random color transfer to src faceset? (0) None, (1) LCT, (2) RCT, (3) RCT-c, (4) RCT-p, "
|
||||
"(5) RCT-pc, (6) mRTC, (7) mRTC-c, (8) mRTC-p, (9) mRTC-pc ?:help skip:%s) : " % default_apply_random_ct,
|
||||
default_apply_random_ct,
|
||||
help_message="Increase variativity of src samples by apply LCT color transfer from random dst "
|
||||
"samples. It is like 'face_style' learning, but more precise color transfer and without "
|
||||
"risk of model collapse, also it does not require additional GPU resources, "
|
||||
"but the training time may be longer, due to the src faceset is becoming more diverse.")
|
||||
"but the training time may be longer, due to the src faceset is becoming more diverse."),
|
||||
ColorTransferMode.NONE, ColorTransferMode.MASKED_RCT_PAPER_CLIP)
|
||||
|
||||
if nnlib.device.backend != 'plaidML': # todo https://github.com/plaidml/plaidml/issues/301
|
||||
default_clipgrad = False if is_first_run else self.options.get('clipgrad', False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue