MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / plot_dur

Method plot_dur

tasks/tts/fs2.py:296–303  ·  view source on GitHub ↗
(self, batch_idx, sample, model_out)

Source from the content-addressed store, hash-verified

294 self.logger.experiment.add_figure(name, spec_to_figure(spec_cat[0], vmin, vmax), self.global_step)
295
296 def plot_dur(self, batch_idx, sample, model_out):
297 T_txt = sample['txt_tokens'].shape[1]
298 dur_gt = mel2ph_to_dur(sample['mel2ph'], T_txt)[0]
299 dur_pred = self.model.dur_predictor.out2dur(model_out['dur']).float()
300 txt = self.phone_encoder.decode(sample['txt_tokens'][0].cpu().numpy())
301 txt = txt.split(" ")
302 self.logger.experiment.add_figure(
303 f'dur_{batch_idx}', dur_to_figure(dur_gt, dur_pred, txt), self.global_step)
304
305 def plot_pitch(self, batch_idx, sample, model_out):
306 f0 = sample['f0']

Callers 1

validation_stepMethod · 0.95

Calls 4

mel2ph_to_durFunction · 0.90
dur_to_figureFunction · 0.90
out2durMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected