快速鍵

VoxCeleb1Verification

class torchaudio.datasets.VoxCeleb1Verification(root: Union[str, Path], meta_url: str = 'https://www.robots.ox.ac.uk/~vgg/data/voxceleb/meta/veri_test.txt', download: bool = False)[source]

用於說話者驗證任務的 VoxCeleb1 [Nagrani et al., 2017] 資料集。

每個資料樣本包含一對波形、取樣率、指示它們是否來自同一個說話者的標籤以及檔案 ID。

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

  • meta_url (str可選) – 包含發言者配對及其對應標籤清單的中繼資料檔案的 URL。每列的格式為 label file_path1 file_path2". For example: ``1 id10270/x6uYqmx31kE/00001.wav id10270/8jEAjG6SegY/00008.wav. 1 表示兩個發言來自同一個說話者,0 表示不是。(預設:"https://www.robots.ox.ac.uk/~vgg/data/voxceleb/meta/veri_test.txt")

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

注意

VoxCeleb1Verification 資料集的檔案結構如下

└─ root/

└─ wav/

└─ speaker_id 資料夾

預先下載了 "vox1_dev_wav.zip""vox1_test_wav.zip" 檔案的使用者,需要將解壓縮後的檔案移動到相同的 root 目錄中。

__getitem__

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

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

參數:

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

傳回:

以下項目的 Tuple;

Tensor

speaker 1 的波形

Tensor

speaker 2 的波形

int

取樣率

int

標籤

str

speaker 1 的檔案 ID

str

speaker 2 的檔案 ID

get_metadata

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

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

參數:

n (int) – 樣本的索引

傳回:

以下項目的 Tuple;

str

speaker 1 的音訊檔案路徑

str

speaker 2 的音訊檔案路徑

int

取樣率

int

標籤

str

speaker 1 的檔案 ID

str

speaker 2 的檔案 ID

文件

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