捷徑

GTZAN

class torchaudio.datasets.GTZAN(root: Union[str, Path], url: str = 'http://opihi.cs.uvic.ca/sound/genres.tar.gz', folder_in_archive: str = 'genres', download: bool = False, subset: Optional[str] = None)[source]

GTZAN [Tzanetakis et al., 2001] 資料集。

注意

如果您計劃使用此資料集來發布結果,請參閱 http://marsyas.info/downloads/datasets.html

注意

截至 2022 年 10 月,下載連結目前無法使用。在 GTZAN 資料集中設定 download=True 將導致 URL 連線錯誤。

參數:
  • root (strPath) – 存放或下載資料集的目錄路徑。

  • url (str, optional) – 從中下載資料集的 URL。(預設值:"http://opihi.cs.uvic.ca/sound/genres.tar.gz"

  • folder_in_archive (str, optional) – 資料集的頂層目錄。

  • download (bool, optional) – 如果在根路徑下找不到資料集,是否下載資料集。(預設值:False)。

  • subset (strNone, optional) – 要使用的資料集子集。選項包括 "training""validation""testing"None。如果為 None,則使用整個資料集。(預設值:None)。

__getitem__

GTZAN.__getitem__(n: int) Tuple[Tensor, int, str][source]

從資料集中載入第 n 個樣本。

參數:

n (int) – 要載入的樣本的索引

返回:

以下項目的元組;

Tensor

波形

int

取樣率

str

標籤

文件

Access comprehensive developer documentation for PyTorch

View Docs

教學

Get in-depth tutorials for beginners and advanced developers

View Tutorials

資源

Find development resources and get your questions answered

View Resources