(self, index)
| 46 | return self.indexed_ds[index] |
| 47 | |
| 48 | def __getitem__(self, index): |
| 49 | hparams = self.hparams |
| 50 | item = self._get_item(index) |
| 51 | max_frames = hparams['max_frames'] |
| 52 | spec = torch.Tensor(item['mel'])[:max_frames] |
| 53 | # mel2ph = torch.LongTensor(item['mel2ph'])[:max_frames] if 'mel2ph' in item else None |
| 54 | f0, uv = norm_interp_f0(item["f0"][:max_frames], hparams) |
| 55 | pitch = torch.LongTensor(item.get("pitch"))[:max_frames] |
| 56 | # print(item.keys(), item['mel'].shape, spec.shape) |
| 57 | sample = { |
| 58 | "id": index, |
| 59 | "item_name": item['item_name'], |
| 60 | "text": item['txt'], |
| 61 | "mel": spec, |
| 62 | "pitch": pitch, |
| 63 | "f0": f0, |
| 64 | "uv": uv, |
| 65 | # "mel2ph": mel2ph, |
| 66 | # "mel_nonpadding": spec.abs().sum(-1) > 0, |
| 67 | } |
| 68 | return sample |
| 69 | |
| 70 | def collater(self, samples): |
| 71 | if len(samples) == 0: |
nothing calls this directly
no test coverage detected