(self)
| 97 | self.process_data('train') |
| 98 | |
| 99 | def _phone_encoder(self): |
| 100 | ph_set_fn = f"{hparams['binary_data_dir']}/phone_set.json" |
| 101 | ph_set = [] |
| 102 | if hparams['reset_phone_dict'] or not os.path.exists(ph_set_fn): |
| 103 | for ph_sent in self.item2ph.values(): |
| 104 | ph_set += ph_sent.split(' ') |
| 105 | ph_set = sorted(set(ph_set)) |
| 106 | json.dump(ph_set, open(ph_set_fn, 'w')) |
| 107 | print("| Build phone set: ", ph_set) |
| 108 | else: |
| 109 | ph_set = json.load(open(ph_set_fn, 'r')) |
| 110 | print("| Load phone set: ", ph_set) |
| 111 | return build_phone_encoder(hparams['binary_data_dir']) |
| 112 | |
| 113 | # @staticmethod |
| 114 | # def get_pitch(wav_fn, spec, res): |
no test coverage detected