def set_label_file_list(self): if self.cfg.GenTestList: self.in_label_align_file_list = prepare_file_path_list( self.test_id_list, self.cfg.in_label_align_dir, self.cfg.lab_ext, False) else: self.in_label_align_file_list = prepare_file_path_list( self.file_id_list, self.cfg.in_label_align_dir, self.cfg.lab_ext, False) if self.cfg.GenTestList and self.cfg.test_synth_dir != 'None' and not self.cfg.VoiceConversion: test_file_list = self._prepare_test_label_file_path_list( self.cfg.test_synth_dir) self.binary_label_file_list = test_file_list self.nn_label_file_list = test_file_list self.nn_label_norm_file_list = test_file_list elif self.cfg.GenTestList: self.binary_label_file_list = self._prepare_test_label_file_path_list( self.binary_label_dir) self.nn_label_file_list = self._prepare_test_label_file_path_list( self.nn_label_dir) self.nn_label_norm_file_list = self._prepare_test_label_file_path_list( self.nn_label_norm_dir) else: self.binary_label_file_list = self._prepare_file_label_file_path_list( self.binary_label_dir) self.nn_label_file_list = self._prepare_file_label_file_path_list( self.nn_label_dir) self.nn_label_norm_file_list = self._prepare_file_label_file_path_list( self.nn_label_norm_dir)
def __init__(self, cfg): self.cfg = cfg self.inter_data_dir = cfg.inter_data_dir if not os.path.exists(self.inter_data_dir): os.makedirs(self.inter_data_dir) self.nn_cmp_dir = os.path.join( self.inter_data_dir, 'nn' + self.cfg.combined_feature_name + '_' + str(self.cfg.cmp_dim)) self.nn_cmp_norm_dir = os.path.join( self.inter_data_dir, 'nn_norm' + self.cfg.combined_feature_name + '_' + str(self.cfg.cmp_dim)) self.model_dir = os.path.join(self.cfg.work_dir, 'nnets_model') self.gen_dir = os.path.join(self.cfg.work_dir, 'gen') self.file_id_list = read_file_list(self.cfg.file_id_scp) self.bottleneck_features = os.path.join(self.gen_dir, 'bottleneck_features') if self.cfg.GenTestList: self.test_id_list = read_file_list(cfg.test_id_scp) self.norm_info_file = os.path.join( self.inter_data_dir, self._NORM_INFO_FILE_NAME % (cfg.combined_feature_name, cfg.cmp_dim, cfg.output_feature_normalisation)) ### save acoustic normalisation information for normalising the features back self.var_dir = os.path.join(self.inter_data_dir, 'var') if not os.path.exists(self.var_dir): os.makedirs(self.var_dir) if self.cfg.MAKEDUR: self.dur_file_list = prepare_file_path_list( self.file_id_list, self.cfg.in_dur_dir, self.cfg.dur_ext) self.nn_cmp_norm_file_list = prepare_file_path_list( self.file_id_list, self.nn_cmp_norm_dir, self.cfg.cmp_ext)
def set_label_dir(self, dimension, suffix, lab_dim): self.binary_label_dir = os.path.join(self.inter_data_dir, 'binary_label_' + str(dimension)) self.nn_label_dir = os.path.join(self.inter_data_dir, 'nn_no_silence_lab_' + suffix) self.nn_label_norm_dir = os.path.join( self.inter_data_dir, 'nn_no_silence_lab_norm_' + suffix) label_norm_file = 'label_norm_%s_%d.dat' % (self.cfg.label_style, lab_dim) self.label_norm_file = os.path.join(self.inter_data_dir, label_norm_file) out_feat_dir = os.path.join(self.inter_data_dir, 'binary_label_' + suffix) self.out_feat_file_list = prepare_file_path_list( self.file_id_list, out_feat_dir, self.cfg.lab_ext)
def _prepare_test_label_file_path_list(self, list_dir): return prepare_file_path_list(self.test_id_list, list_dir, self.cfg.lab_ext)
def get_lf0_file_list(self): return prepare_file_path_list(self.file_id_list, self.cfg.in_lf0_dir, self.cfg.lf0_ext)
def get_nn_cmp_file_list(self): return prepare_file_path_list(self.file_id_list, self.nn_cmp_dir, self.cfg.cmp_ext)