summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-07-23 16:26:19 +0200
committerJules Laplace <julescarbon@gmail.com>2018-07-23 16:26:19 +0200
commit2af5881348ea12ef203036dbbb2d872b6a556eba (patch)
tree2468c753ae0d237b5eecc36b1c149d37c60c61d2
parent40279603a742acb782c73be3d77558b92eb0855e (diff)
process
-rw-r--r--scripts/process.py7
1 files changed, 4 insertions, 3 deletions
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,