Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the popular GTZAN dataset: #668

Merged
merged 7 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/source/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ COMMONVOICE
:special-members:


GTZAN
~~~~~

.. autoclass:: GTZAN
:members: __getitem__
:special-members:


LIBRISPEECH
~~~~~~~~~~~

Expand Down
Binary file added test/assets/genres/noise/noise.0000.wav
Binary file not shown.
5 changes: 5 additions & 0 deletions test/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from torchaudio.datasets.vctk import VCTK
from torchaudio.datasets.yesno import YESNO
from torchaudio.datasets.ljspeech import LJSPEECH
from torchaudio.datasets.gtzan import GTZAN

from . import common_utils

Expand Down Expand Up @@ -55,6 +56,10 @@ def test_speechcommands(self):
data = SPEECHCOMMANDS(self.path)
data[0]

def test_gtzan(self):
data = GTZAN(self.path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other tests include a first dummy file with a directory structure to mimic the dataset in the repository. The default value of download is False and we do not want the tests to download files anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry it seems I missed this part. I will fix it.

data[0]


if __name__ == "__main__":
unittest.main()
2 changes: 2 additions & 0 deletions torchaudio/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .speechcommands import SPEECHCOMMANDS
from .utils import bg_iterator, diskcache_iterator
from .vctk import VCTK
from .gtzan import GTZAN
from .yesno import YESNO
from .ljspeech import LJSPEECH

Expand All @@ -13,6 +14,7 @@
"VCTK",
"YESNO",
"LJSPEECH",
"GTZAN",
"diskcache_iterator",
"bg_iterator",
)
Loading