(spec, f0s, figsize=None)
| 14 | |
| 15 | |
| 16 | def spec_f0_to_figure(spec, f0s, figsize=None): |
| 17 | max_y = spec.shape[1] |
| 18 | if isinstance(spec, torch.Tensor): |
| 19 | spec = spec.detach().cpu().numpy() |
| 20 | f0s = {k: f0.detach().cpu().numpy() for k, f0 in f0s.items()} |
| 21 | f0s = {k: f0 / 10 for k, f0 in f0s.items()} |
| 22 | fig = plt.figure(figsize=(12, 6) if figsize is None else figsize) |
| 23 | plt.pcolor(spec.T) |
| 24 | for i, (k, f0) in enumerate(f0s.items()): |
| 25 | plt.plot(f0.clip(0, max_y), label=k, c=LINE_COLORS[i], linewidth=1, alpha=0.8) |
| 26 | plt.legend() |
| 27 | return fig |
| 28 | |
| 29 | |
| 30 | def dur_to_figure(dur_gt, dur_pred, txt): |
nothing calls this directly
no outgoing calls
no test coverage detected