(self, target)
| 135 | return x[crop_pos : crop_pos + crop_size] |
| 136 | |
| 137 | def prompt_text(self, target): |
| 138 | events = _AUDIOSET_MAP[np.where(target > 0)] |
| 139 | event_text = "The sounds of " + ", ".join(events[:-1]) + " and " + events[-1] |
| 140 | text = tokenize(event_text)[0] |
| 141 | return text |
| 142 | |
| 143 | def __getitem__(self, index): |
| 144 | """Load waveform, text, and target of an audio clip |