【问题标题】:FileNotFoundError: "pyannote.database"FileNotFoundError:“pyannote.database”
【发布时间】:2020-11-16 16:09:07
【问题描述】:

目前我正在 python 上使用 pyannote 进行嵌入的扬声器 Diarization。 我通过命令安装pynnote:

!pip install -q https://github.com/pyannote/pyannote-audio/tarball/develop

我的嵌入函数如下所示:

import torch
import librosa
from pyannote.core import Segment

def embeddings_(audio_path,resegmented,range):
    model_emb = torch.hub.load('pyannote/pyannote-audio', 'emb')
  
    embedding = model_emb({'audio': audio_path})
    for window, emb in embedding:
            assert isinstance(window, Segment)
            assert isinstance(emb, np.ndarray)

    y, sr = librosa.load(audio_path)
    myDict={}
    myDict['audio'] = audio_path
    myDict['duration'] = len(y)/sr

    data=[]
    for i in resegmented:
            excerpt = Segment(start=i[0], end=i[0]+range)
            emb = model_emb.crop(myDict,excerpt)
            data.append(emb.T)
    data= np.asarray(data)
  
    return data.reshape(len(data),512)

当我调用函数时:

embeddings = embeddings_(audiofile,resegmented,2) 

我收到了这个错误:

FileNotFoundError: "pyannote.database" relies on a YAML configuration file but could not find any. Here are the locations that were looked for: /home/subhash/Untitled Folder/Inpycgam/database.yml, /home/subhash/.pyannote/database.yml.

源代码:https://github.com/muskang48/Speaker-Diarization/blob/master/sp_diarization.ipynb

【问题讨论】:

    标签: python machine-learning deep-learning voice-recognition pyaudio


    【解决方案1】:

    在执行任何实验之前,您必须遵循此one。在这里,他们描述了如何创建一个配置文件并告诉解释器它的位置,以便在运行时可以找到它

    【讨论】:

      猜你喜欢
      • 2021-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-10
      • 2021-08-27
      相关资源
      最近更新 更多