wangerxian 发表于 2024-9-20 14:37

Windows语音识别本地部署 FunASR

本帖最后由 wangerxian 于 2024-9-20 14:36 编辑

<h2 data-spm-anchor-id="0.0.0.i5.243451b0MBCBCg" id="0、环境安装">0、环境安装</h2>

<h3 id="1--vs环境安装:">1. VS环境安装:</h3>

<p>如果您没有Visual Studio 2022 c++运行环境,双击 VC_redist.x64(2022).exe 安装 Visual Studio 2022环境下编译的C++程序运行所需要的库;</p>

<h3 id="2--git安装:">2. git安装:</h3>

<h4 id="11----下载地址:">1.1 下载地址:</h4>

<p><a href="https://git-scm.com/download/win" rel="noreferrer" target="_blank">官网下载</a>&nbsp;(如遇网络问题,大陆用户可以使用下述地址:<a href="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/windows/Git-2.42.0.2-64-bit.exe.zip" rel="noreferrer" target="_blank">oss镜像</a>)</p>

<h4 id="12----如何进入git-bash命令行可参考:">1.2 如何进入git bash命令行可参考:</h4>

<p>点击开始菜单,找到Git文件夹;在Git文件夹中,点击&ldquo;Git Bash&rdquo;</p>

<h4 id="13----git-bash安装lfs:">1.3 Git Bash安装lfs:</h4>

<p><code class="hljs">git lfs install</code></p>

<h2 id="1、funasr中文离线文件转写服务部署">1、FunASR中文离线文件转写服务部署</h2>

<h3 id="1--git-bash运行下述命令,下载相关模型至:">1. Git Bash运行下述命令,下载相关模型至:</h3>

<p><code node="">D:/funasr-runtime-resources/models</code></p>

<p>下载指令:</p>

<pre>
<code> mkdir -p D:/funasr-runtime-resources/models &amp;&amp; cd D:/funasr-runtime-resources/models;

git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-onnx.git;

git clone https://www.modelscope.cn/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx.git;

git clone https://www.modelscope.cn/damo/speech_ngram_lm_zh-cn-ai-wesp-fst.git;

git clone https://www.modelscope.cn/damo/punc_ct-transformer_cn-en-common-vocab471067-large-onnx.git;

git clone https://www.modelscope.cn/thuduj12/fst_itn_zh.git

# 如果您想使用8k模型,请下载8k模型:
git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-8k-common-onnx.git;

git clone https://www.modelscope.cn/damo/speech_paraformer_asr_nat-zh-cn-8k-common-vocab8358-tensorflow1-onnx.git;

git clone https://www.modelscope.cn/damo/speech_ngram_lm_zh-cn-ai-wesp-fst-token8358.git;

git clone https://www.modelscope.cn/damo/punc_ct-transformer_cn-en-common-vocab471067-large-onnx.git;

git clone https://www.modelscope.cn/thuduj12/fst_itn_zh.git</code></pre>

<h3 id="2--git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动服务端:">2. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动服务端:</h3>

<pre>
<code>./funasr-wss-server.exe--vad-dir D:/funasr-runtime-resources/models/speech_fsmn_vad_zh-cn-16k-common-onnx --model-dir D:/funasr-runtime-resources/models/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx --lm-dir D:/funasr-runtime-resources/models/speech_ngram_lm_zh-cn-ai-wesp-fst--punc-dir D:/funasr-runtime-resources/models/punc_ct-transformer_cn-en-common-vocab471067-large-onnx --itn-dir D:/funasr-runtime-resources/models/fst_itn_zh --certfile ssl_key/server.crt --keyfile ssl_key/server.key

# 如果您想使用8k模型:
./funasr-wss-server.exe--vad-dir D:/funasr-runtime-resources/models/speech_fsmn_vad_zh-cn-8k-common-onnx --model-dir D:/funasr-runtime-resources/models/speech_paraformer_asr_nat-zh-cn-8k-common-vocab8358-tensorflow1-onnx --lm-dir D:/funasr-runtime-resources/models/speech_ngram_lm_zh-cn-ai-wesp-fst-token8358--punc-dir D:/funasr-runtime-resources/models/punc_ct-transformer_cn-en-common-vocab471067-large-onnx --itn-dir D:/funasr-runtime-resources/models/fst_itn_zh --certfile ssl_key/server.crt --keyfile ssl_key/server.key</code></pre>

<h3 id="3--git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动客户端:">3. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动客户端:</h3>

<p><code class="hljs">./funasr-wss-client.exe --server-ip 127.0.0.1 --port 10095 --wav-path asr_example_zh.wav</code></p>

<h3 id="4--详情及客户端用法可参考:">4. 详情及客户端用法可参考:</h3>

<p><a href="https://github.com/alibaba-damo-academy/FunASR/blob/main/runtime/docs/SDK_advanced_guide_offline_zh.md#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E7%94%A8%E6%B3%95%E8%AF%A6%E8%A7%A3" rel="noreferrer" target="_blank">完整示例与用法</a></p>

<h2 id="2、funasr实时语音听写服务部署">2、FunASR实时语音听写服务部署</h2>

<h3 id="1--git-bash运行下述命令,下载相关模型至:">1. Git Bash运行下述命令,下载相关模型至:</h3>

<p><code node="">D:/funasr-runtime-resources/models</code>:</p>

<p>下载指令:</p>

<pre>
<code> mkdir -p D:/funasr-runtime-resources/models &amp;&amp; cd D:/funasr-runtime-resources/models;

git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-onnx.git;

git clone https://www.modelscope.cn/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx.git;

git clone https://www.modelscope.cn/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online-onnx.git;

git clone https://www.modelscope.cn/damo/speech_ngram_lm_zh-cn-ai-wesp-fst.git;

git clone https://www.modelscope.cn/damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727-onnx.git;

git clone https://www.modelscope.cn/thuduj12/fst_itn_zh.git</code></pre>

<h3 id="2--git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动服务端:-2">2. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动服务端:</h3>

<pre>
<code>./funasr-wss-server-2pass.exe --vad-dir D:/funasr-runtime-resources/models/speech_fsmn_vad_zh-cn-16k-common-onnx --model-dirD:/funasr-runtime-resources/models/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx --online-model-dir D:/funasr-runtime-resources/models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online-onnx--lm-dir D:/funasr-runtime-resources/models/speech_ngram_lm_zh-cn-ai-wesp-fst--punc-dir D:/funasr-runtime-resources/models/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727-onnx --itn-dir D:/funasr-runtime-resources/models/fst_itn_zh --certfile ssl_key/server.crt --keyfile ssl_key/server.key</code></pre>

<h3>&nbsp;</h3>

<h3 id="3--git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动客户端:-2">3. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动客户端:</h3>

<p><code class="hljs">./funasr-wss-client-2pass.exe --server-ip 127.0.0.1 --port 10095 --wav-path asr_example_zh.wav</code></p>

<h3 id="4--详情及客户端用法可参考:-2">4. 详情及客户端用法可参考:</h3>

<p><a href="https://github.com/alibaba-damo-academy/FunASR/blob/main/runtime/docs/SDK_advanced_guide_online_zh.md#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E7%94%A8%E6%B3%95%E8%AF%A6%E8%A7%A3" rel="noreferrer" target="_blank">完整示例与用法</a></p>

<h2 id="3、funasr英文离线文件转写服务部署">3、FunASR英文离线文件转写服务部署</h2>

<h3 id="1--git-bash运行下述命令,下载相关模型至:-2">1. Git Bash运行下述命令,下载相关模型至:</h3>

<p><code node="">D:/funasr-runtime-resources/models</code></p>

<p>下载指令:</p>

<pre>
<code> mkdir -p D:/funasr-runtime-resources/models &amp;&amp; cd D:/funasr-runtime-resources/models;

git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-onnx.git;

git clone https://www.modelscope.cn/damo/speech_paraformer-large_asr_nat-en-16k-common-vocab10020-onnx.git;

git clone https://www.modelscope.cn/damo/punc_ct-transformer_cn-en-common-vocab471067-large-onnx.git</code></pre>

<p>&nbsp;</p>

<h3 id="2---git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动服务端:">2. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动服务端:</h3>

<pre>
<code>./funasr-wss-server.exe   --vad-dir D:/funasr-runtime-resources/models/speech_fsmn_vad_zh-cn-16k-common-onnx --model-dir D:/funasr-runtime-resources/models/speech_paraformer-large_asr_nat-en-16k-common-vocab10020-onnx--punc-dir D:/funasr-runtime-resources/models/punc_ct-transformer_cn-en-common-vocab471067-large-onnx--certfile ssl_key/server.crt --keyfile ssl_key/server.key</code></pre>

<p>&nbsp;</p>

<h3 id="3--git-bash在项目目录(funasr-runtime-win-cpu-x64-v020)启动客户端:-3">3. Git Bash在项目目录(funasr-runtime-win-cpu-x64-v0.2.0)启动客户端:</h3>

<p><code class="hljs">./funasr-wss-client-2pass.exe --server-ip 127.0.0.1 --port 10095 --wav-path asr_example_zh.wav</code></p>

<h3 id="4--详情及客户端用法可参考:-3">4. 详情及客户端用法可参考:</h3>

<p><a href="https://github.com/alibaba-damo-academy/FunASR/blob/main/runtime/docs/SDK_advanced_guide_offline_en_zh.md#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E7%94%A8%E6%B3%95%E8%AF%A6%E8%A7%A3" rel="noreferrer" target="_blank">完整示例与用法</a></p>

<h4 id="clone-with-http">Clone with HTTP</h4>

<p><code class="hljs">git clone <a href="https://www.modelscope.cn/damo/funasr-runtime-win-cpu-x64.git" target="_blank">https://www.modelscope.cn/damo/funasr-runtime-win-cpu-x64.git</a></code></p>

hellokitty_bean 发表于 2024-9-20 21:20

<p>xian哥,这个不错耶。。。。。。。。。。。。。。</p>

<p>点赞点赞。。。。。。</p>

wangerxian 发表于 2024-9-23 09:07

hellokitty_bean 发表于 2024-9-20 21:20
xian哥,这个不错耶。。。。。。。。。。。。。。

点赞点赞。。。。。。

<p>FunASR是我认为目前开源识别汉语最好用的语音识别。</p>

hellokitty_bean 发表于 2024-9-23 11:30

<p>嗯嗯嗯。。。。。。。。。。值得玩儿。。。。。。。。。。。<img height="48" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/loveliness.gif" width="48" /></p>

hellokitty_bean 发表于 2024-10-23 11:03

<p>xian哥,这个funasr-wss-server.exe 在哪里下载?。。。。。。。<img height="48" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/smile.gif" width="48" /></p>

wangerxian 发表于 2024-10-23 16:49

hellokitty_bean 发表于 2024-10-23 11:03
xian哥,这个funasr-wss-server.exe 在哪里下载?。。。。。。。

<p>官方git里面应该就有,最近准备搭建一下发一篇帖子。</p>
页: [1]
查看完整版本: Windows语音识别本地部署 FunASR