rename dump_dflive to export_dfm

This commit is contained in:
iperov 2021-06-28 18:26:54 +04:00
parent 9d6b6feb1f
commit 63c794b3d0
4 changed files with 12 additions and 12 deletions

10
main.py
View File

@ -148,15 +148,15 @@ if __name__ == "__main__":
p.add_argument('--execute-program', dest="execute_program", default=[], action='append', nargs='+')
p.set_defaults (func=process_train)
def process_dumpdflive(arguments):
def process_exportdfm(arguments):
osex.set_process_lowest_prio()
from mainscripts import DumpDFLive
DumpDFLive.main(model_class_name = arguments.model_name, saved_models_path = Path(arguments.model_dir))
from mainscripts import ExportDFM
ExportDFM.main(model_class_name = arguments.model_name, saved_models_path = Path(arguments.model_dir))
p = subparsers.add_parser( "dumpdflive", help="Dump model to use in DFLive.")
p = subparsers.add_parser( "exportdfm", help="Export model to use in DeepFaceLive.")
p.add_argument('--model-dir', required=True, action=fixPathAction, dest="model_dir", help="Saved models dir.")
p.add_argument('--model', required=True, dest="model_name", choices=pathex.get_all_dir_names_startswith ( Path(__file__).parent / 'models' , 'Model_'), help="Model class name.")
p.set_defaults (func=process_dumpdflive)
p.set_defaults (func=process_exportdfm)
def process_merge(arguments):
osex.set_process_lowest_prio()

View File

@ -19,4 +19,4 @@ def main(model_class_name, saved_models_path):
is_training=False,
saved_models_path=saved_models_path,
cpu_only=True)
model.dump_dflive ()
model.export_dfm ()

View File

@ -638,10 +638,10 @@ class AMPModel(ModelBase):
self.update_sample_for_preview(force_new=True)
def dump_dflive (self):
output_path=self.get_strpath_storage_for_file('model.dflive')
def export_dfm (self):
output_path=self.get_strpath_storage_for_file('model.dfm')
io.log_info(f'Dumping .dflive to {output_path}')
io.log_info(f'Dumping .dfm to {output_path}')
tf = nn.tf
with tf.device (nn.tf_default_device_name):

View File

@ -659,10 +659,10 @@ Examples: df, liae, df-d, df-ud, liae-ud, ...
if self.pretrain_just_disabled:
self.update_sample_for_preview(force_new=True)
def dump_dflive (self):
output_path=self.get_strpath_storage_for_file('model.dflive')
def export_dfm (self):
output_path=self.get_strpath_storage_for_file('model.dfm')
io.log_info(f'Dumping .dflive to {output_path}')
io.log_info(f'Dumping .dfm to {output_path}')
tf = nn.tf
nn.set_data_format('NCHW')