paddlespeech.cli.vector.infer 模块

class paddlespeech.cli.vector.infer.VectorExecutor[来源]

基础: BaseExecutor

方法

disable_task_loggers()

禁用当前任务中的所有日志记录器。

execute(argv)

向量模型的命令行入口

get_embeddings_score(enroll_embedding, ...)

获取注册嵌入和测试嵌入分数

get_input_source(input_)

从命令行输入获取任务输入源。

infer(model_type)

推断模型以获取嵌入

postprocess()

返回音频嵌入信息

preprocess(model_type, input_file)

提取音频特征

process_task_results(input_, results[, ...])

处理任务结果并在需要时重定向标准输出。

show_rtf(info)

计算当前任务的rft并显示结果。

__call__

execute(argv: List[str]) bool[来源]

向量模型的命令行输入

Args:

argv (List[str]): 命令行参数列表

Returns:
bool:

假: 一些音频发生错误
真: 所有音频处理成功

get_embeddings_score(enroll_embedding, test_embedding)[来源]

获取注册嵌入和测试嵌入得分

Args:

enroll_embedding (numpy.array): 形状: (emb_size), 注册音频嵌入 test_embedding (numpy.array): 形状: (emb_size), 测试音频嵌入

Returns:

分数:注册嵌入和测试嵌入之间的分数

infer(model_type: str)[来源]

推断模型以获取嵌入

Args:

model_type (str):说话人验证模型类型

postprocess() Union[str, PathLike][来源]

返回音频嵌入信息

Returns:

Union[str, os.PathLike]: 音频嵌入信息

preprocess(model_type: str, input_file: Union[str, PathLike])[来源]

提取音频特征

Args:

model_type (str): 说话人验证模型类型
input_file (Union[str, os.PathLike]): 音频文件路径