捷徑

Musan

class torchaudio.prototype.datasets.Musan(root: Union[str, Path], subset: str)[原始碼]

MUSAN [Snyder et al., 2015] 資料集。

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

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

__getitem__

Musan.__getitem__(n: int) Tuple[Tensor, int, str][原始碼]

傳回資料集中第 n 個樣本。

參數:

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

傳回:

torch.Tensor

波形。

int

取樣率。

str

檔案名稱。

回傳型別:

(torch.Tensor, int, str)

get_metadata

Musan.get_metadata(n: int) Tuple[str, int, str][原始碼]

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

參數:

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

傳回:

str

音訊檔案路徑。

int

取樣率。

str

檔案名稱。

回傳型別:

(str, int, str)

文件

存取 PyTorch 的完整開發者文件

查看文件

教學

取得初學者和進階開發者的深入教學

查看教學

資源

尋找開發資源並獲得問題解答

查看資源