k2語音識別:如何使用sherpa-onnx
一、安裝k2
二、編譯 sherpa-onnx c++ server
三、官方文檔:
https://k2-fsa.github.io/sherpa/onnx/index.html
四、模型下載:
https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html
五、使用c++程序
1)啟動websocket server,并指定模型:
幫助:
執(zhí)行:
2) 啟動sherpa-onnx-online-websocket-client
幫助:
執(zhí)行:
ps:也可以使用sherpa(https://github.com/k2-fsa/sherpa.git)啟動web client,調用sherpa-onnx c++ websocket server
3)啟動microphone test:
幫助:
執(zhí)行:
4) 識別一個音頻文件:
幫助:
執(zhí)行:
六、使用python-api-example示例:
1)識別一個音頻文件:
執(zhí)行:
2)使用麥克風輸入流式數(shù)據(jù),調用websocket解碼:
執(zhí)行:
3)使用microphone
執(zhí)行
4) 使用microphone,帶端點檢測
執(zhí)行:
使用Onnxruntime推理模型,并發(fā)量及解碼速度都有很大提升。