From 2af5881348ea12ef203036dbbb2d872b6a556eba Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 23 Jul 2018 16:26:19 +0200 Subject: process --- scripts/process.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/process.py') diff --git a/scripts/process.py b/scripts/process.py index bd25b3c..60c8e16 100644 --- a/scripts/process.py +++ b/scripts/process.py @@ -31,12 +31,14 @@ output_directory = args.output_directory it = args.iteration gpu = args.gpu +conv_config = create_conv_config(conv_model / 'config.json') +sr_config = create_sr_config(sr_model / 'config.json') + def extract_number(f): s = re.findall("\d+", str(f)) return int(s[-1]) if s else -1 def load_acoustic_converter(): - conv_config = create_conv_config(conv_model / 'config.json') if it is not None: conv_model_path = conv_model / 'predictor_{}.npz'.format(it) else: @@ -44,9 +46,7 @@ def load_acoustic_converter(): conv_model_path = list(sorted(conv_model_paths, key=extract_number))[-1] print(conv_model_path) return AcousticConverter(conv_config, conv_model_path, gpu=gpu) - def load_super_resolution(): - sr_config = create_sr_config(sr_model / 'config.json') sr_model_paths = sr_model.glob('predictor*.npz') sr_model_path = list(sorted(sr_model_paths, key=extract_number))[-1] print(sr_model_path) @@ -57,6 +57,7 @@ def process(p: Path, acoustic_converter: AcousticConverter, super_resolution: Su print(str(p)) input = acoustic_converter(p) + param = sr_config.dataset.param acoustic_feature_process = AcousticFeatureProcess( frame_period=param.acoustic_feature_param.frame_period, order=param.acoustic_feature_param.order, -- cgit v1.2.3-70-g09d2