archinetai / audio-data-pytorch

A collection of useful audio datasets and transforms for PyTorch.
MIT License
129 stars 22 forks source link

fix: bugs with MetaDataset & random crop + add dependencies #4

Closed zaptrem closed 1 year ago

zaptrem commented 1 year ago

This PR fixes a few issues I ran into while setting things up with ZQEvans' dataset.

The dataloader could cause a crash in certain cases...

Additionally, while pandas and yt_dlp are required to import the library, they previously weren't listed in dependencies.

flavioschneider commented 1 year ago

Can you put the ID3 extension in a WavID3Dataset or something named like that, and the argument for the optimized random crop you can simply call it random_crop

zaptrem commented 1 year ago

Can you put the ID3 extension in a WavID3Dataset or something named like that, and the argument for the optimized random crop you can simply call it random_crop

I renamed optimized_random_crop_size to random_crop_size, but the ID3 extension will be difficult to move. I moved it there in the first place to handle the case where torchaudio is able to read a file but TinyTag isn't. Moving it back outside would require a complicated dance of calling back and fourth to and from the superclass's load functions and lots of catch logic that would complicate MetaDataset (but is a one-liner when in WAVDataset).