快捷鍵

VGGishBundle

class torchaudio.prototype.pipelines.VGGishBundle[原始碼]

VGGish [Hershey et al., 2017] 推論 Pipeline,移植自 torchvggishtensorflow-models

範例

>>> import torchaudio
>>> from torchaudio.prototype.pipelines import VGGISH
>>>
>>> input_sr = VGGISH.sample_rate
>>> input_proc = VGGISH.get_input_processor()
>>> model = VGGISH.get_model()
>>>
>>> waveform, sr = torchaudio.load(
>>>     "Chopin_Ballade_-1_In_G_Minor,_Op._23.mp3",
>>> )
>>> waveform = waveform.squeeze(0)
>>> waveform = torchaudio.functional.resample(waveform, sr, input_sr)
>>> mono_output = model(input_proc(waveform))

屬性

sample_rate

property VGGishBundle.sample_rate: int

輸入處理器和模型預期的輸入波形取樣率。

類型:

int

方法

get_input_processor

VGGishBundle.get_input_processor() VGGishInputProcessor[原始碼]

建構 VGGish 的輸入處理器。

返回:

VGGish 的輸入處理器。

返回類型:

VGGishInputProcessor

get_model

VGGishBundle.get_model() VGGish[原始碼]

建構預訓練的 VGGish 模型。必要時下載並快取權重。

返回:

已載入預訓練權重的 VGGish 模型。

返回類型:

VGGish

文件

存取 PyTorch 的完整開發者文件

查看文件

教學

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

查看教學

資源

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

查看資源