wenet-e2e / wespeaker

Research and Production Oriented Speaker Verification, Recognition and Diarization Toolkit
Apache License 2.0
703 stars 116 forks source link

onnx 形式的预训练模型固定了帧长是有什么特别的考虑吗? #380

Open songfuture opened 4 hours ago

songfuture commented 4 hours ago

首先非常感谢如此优秀的项目! 请教一下,

  1. 导出的onnx形式的预训练模型的帧数维为什么是固定的200而不是动态的任意帧数?是结合了训练模型的chunk包含的帧数考虑的吗?还是考虑了CMN阶段的帧数要求?
  2. 如果固定帧数为200,当一条语音包含的帧数不是200的整数倍时,应该如何处理剩余的帧?如语音包含278帧,[0:200]帧可以用onnx模型进行推理,剩余的78帧应该如何使用模型进行推理呢?用[78:278]把剩余的78帧也利用起来,还是[200:278]重复至200帧送入onnx进行推理呢?
cdliang11 commented 4 hours ago

非常感谢对这个项目的关注!

导出onnx支持动态维度,如下: https://github.com/wenet-e2e/wespeaker/blob/e9bbf73d0fd13db6cf42a6cb2eafb0d7dd0f8e0e/wespeaker/bin/export_onnx.py#L84-L88

songfuture commented 1 hour ago

非常感谢对这个项目的关注!

导出onnx支持动态维度,如下:

https://github.com/wenet-e2e/wespeaker/blob/e9bbf73d0fd13db6cf42a6cb2eafb0d7dd0f8e0e/wespeaker/bin/export_onnx.py#L84-L88

songfuture commented 1 hour ago

请问一下如何获得发布的预训练模型的config呢,这样才能重新导出动态帧数维的预训练onnx模型?

image
cdliang11 commented 47 minutes ago

请问一下如何获得发布的预训练模型的config呢,这样才能重新导出动态帧数维的预训练onnx模型? image

你好,预训练模型下载页面:https://github.com/wenet-e2e/wespeaker/blob/master/docs/pretrained.md,里边提供了pytorch模型(包含config文件)和onnx模型,其中onnx模型是动态维度