源码编译 FunASR for windows on arm

源码编译 FunASR for windows on arm

AI学习交流qq群873673497
官网turingevo.com
邮箱wmx@turingevo.com
githubhttps://github.com/turingevo
huggingfacehttps://huggingface.co/turingevo

这里有编译好的,直接下载使用

https://github.com/turingevo/FunASR-build/releases

编译

FFMPEG_DIR=C:\workspace\program\ffmpeg-wos-arm64
ONNXRUNTIME_DIR=C:\workspace\program\onnxruntime-win-arm64-1.16.1
OPENSSL_ROOT_DIR=C:\workspace\program\OpenSSL

在这里插入图片描述
configure 、generate 用vsual studio 打开,编译

在这里插入图片描述
生成文件在这里:C:\workspace\FunASR\runtime\websocket\build\bin\Release

使用

1 下载模型:

在modelscope : https://www.modelscope.cn/models
直接搜索模型名称,然后下载,放在路径下C:\workspace\models\

iic/speech_fsmn_vad_zh-cn-16k-common-onnx 
iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch  
iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx
iic/punc_ct-transformer_cn-en-common-vocab471067-large-onnx 
iic/speech_ngram_lm_zh-cn-ai-wesp-fst 
thuduj12/fst_itn_zh 
2 下载测试音频:

https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav

3 启用server:

在FunASR/runtime/ 路径下,新建 run_server.bat 文件:

@echo off
:: Start the command directly
"C:\workspace\FunASR\runtime\websocket\build\bin\Release\funasr-wss-server.exe" ^
    --download-model-dir "C:\workspace\models" ^
    --model-dir "C:\workspace\models\speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx"
    --itn-dir "C:\workspace\models\fst_itn_zh" ^
    --lm-dir "C:\workspace\models\speech_ngram_lm_zh-cn-ai-wesp-fst" ^
    --decoder-thread-num 4 ^
    --model-thread-num 4 ^
    --io-thread-num 4 ^
    --port 10095 ^
    --certfile "C:\workspace\FunASR\runtime\ssl_key\server.crt" ^
    --keyfile "C:\workspace\FunASR\runtime\ssl_key\server.key" ^
	--hotword "C:\workspace\FunASR\runtime\websocket\hotwords.txt"
4 运行client:

在FunASR/runtime/ 路径下打开cmd,输入:

websocket/build/bin/funasr-wss-client --server-ip 127.0.0.1 --port 10095 --wav-path asr_example_zh.wav

输出:

{"is_final":false,"mode":"offline","stamp_sents":[{"end":5195,"punc":"。","start":880,"text_seg":"欢 迎 大 家 来 体 验 达 摩 院 推 出 的 语 音 识 别 模 型","ts_list":[[880,1120],[1120,1380],[1380,1540],[1540,1780],[1780,2020],[2020,2180],[2180,2480],[2480,2600],[2600,2780],[2780,3040],[3040,3240],[3240,3480],[3480,3699],[3699,3900],[3900,4180],[4180,4420],[4420,4620],[4620,4780],[4780,5195]]}],"text":"欢迎大家来体验达摩院推出的语音识别模型。","timestamp":"[[880,1120],[1120,1380],[1380,1540],[1540,1780],[1780,2020],[2020,2180],[2180,2480],[2480,2600],[2600,2780],[2780,3040],[3040,3240],[3240,3480],[3480,3699],[3699,3900],[3900,4180],[4180,4420],[4420,4620],[4620,4780],[4780,5195]]","wav_name":"wav_default_id"}

提取其中的text字段的值,就是解码结果
"欢迎大家来体验达摩院推出的语音识别模型。"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值