快捷方式

Musan

torchaudio.prototype.datasets.Musan(root: Union[str, Path], subset: str)[source]

MUSAN [Snyder 等人,2015] 資料集。

引數:
  • root (strPath) – 資料集頂層目錄所在的根目錄。

  • subset (str) – 要使用的資料集子集。選項:["music", "noise", "speech"]。

__getitem__

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

返回資料集中的第 n 個樣本。

引數:

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

返回:

torch.Tensor

波形。

int

取樣率。

str

檔名。

返回型別:

(torch.Tensor, int, str)

get_metadata

Musan.get_metadata(n: int) Tuple[str, int, str][source]

獲取資料集中第 n 個樣本的元資料。返回檔案路徑而不是波形,但其他欄位與 __getitem__() 返回的相同。

引數:

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

返回:

str

音訊路徑。

int

取樣率。

str

檔名。

返回型別:

(str, int, str)

文件

訪問 PyTorch 綜合開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源