From 17e8f5b889be2ad31608b5203dc5fbc5fd5c0f8a Mon Sep 17 00:00:00 2001 From: nichongjia-2007 <nichongjia@gmail.com> Date: 星期四, 20 七月 2023 21:26:58 +0800 Subject: [PATCH] Merge branch 'main' of https://github.com/alibaba-damo-academy/FunASR --- funasr/runtime/html5/readme_zh.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/funasr/runtime/html5/readme_zh.md b/funasr/runtime/html5/readme_zh.md new file mode 100644 index 0000000..1010838 --- /dev/null +++ b/funasr/runtime/html5/readme_zh.md @@ -0,0 +1,93 @@ +(绠�浣撲腑鏂噟[English](./readme.md)) + +# 璇煶璇嗗埆鏈嶅姟Html5瀹㈡埛绔闂晫闈� + +鏈嶅姟绔儴缃查噰鐢╳ebsocket鍗忚锛屽鎴风鍙互鏀寔html5缃戦〉璁块棶锛屾敮鎸侀害鍏嬮杈撳叆涓庢枃浠惰緭鍏ワ紝鍙互閫氳繃濡備笅2绉嶆柟寮忚闂細 +- 鏂瑰紡涓�锛� + + html瀹㈡埛绔洿杩烇紝鎵嬪姩涓嬭浇瀹㈡埛绔紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/html5/static)锛夎嚦鏈湴锛屾墦寮�`index.html`缃戦〉锛岃緭鍏ss鍦板潃涓庣鍙e彿 + +- 鏂瑰紡浜岋細 + + html5鏈嶅姟绔紝鑷姩涓嬭浇瀹㈡埛绔嚦鏈湴锛屾敮鎸佹墜鏈虹瓑绔笂璁块棶 + +## 璇煶璇嗗埆鏈嶅姟鍚姩 + +鏀寔python鐗堟湰涓巆++鐗堟湰鏈嶅姟閮ㄧ讲锛屽叾涓� + +- python鐗堟湰 + + 鐩存帴閮ㄧ讲python pipeline锛屾敮鎸佹祦寮忓疄鏃惰闊宠瘑鍒ā鍨嬶紝绂荤嚎璇煶璇嗗埆妯″瀷锛屾祦寮忕绾夸竴浣撳寲绾犻敊妯″瀷锛岃緭鍑哄甫鏍囩偣鏂囧瓧銆傚崟涓猻erver锛屾敮鎸佸崟涓猚lient銆� + +- c++鐗堟湰 + + funasr-runtime-sdk锛屾敮鎸佷竴閿儴缃诧紝0.1.0鐗堟湰锛屾敮鎸佺绾挎枃浠惰浆鍐欍�傚崟涓猻erver锛屾敮鎸佷笂鐧捐矾client璇锋眰銆� + +### python鐗堟湰鏈嶅姟鍚姩 + +#### 瀹夎渚濊禆鐜 + +```shell +pip3 install -U modelscope funasr flask +# 涓浗澶ч檰鐢ㄦ埛锛屽鏋滈亣鍒扮綉缁滈棶棰橈紝鍙互閫氳繃涓嬮潰鎸囦护瀹夎锛� +# pip3 install -U modelscope funasr -i https://mirror.sjtu.edu.cn/pypi/web/simple +git clone https://github.com/alibaba/FunASR.git && cd FunASR +``` + +#### 鍚姩ASR鏈嶅姟 + +#### wss鏂瑰紡 + +```shell +cd funasr/runtime/python/websocket +python funasr_wss_server.py --port 10095 +``` + +璇︾粏鍙傛暟閰嶇疆涓庤В鏋愶紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)锛� + +#### html5鏈嶅姟锛堝彲閫夛級 + +濡傛灉闇�瑕佷娇鐢ㄤ笂闈㈡墍璇寸殑瀹㈡埛绔柟寮忎簩锛岃繘琛岃闂紝鍙互鍚姩html5鏈嶅姟 +```shell +h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE] +``` +渚嬪瓙濡備笅锛岄渶瑕佹敞鎰廼p鍦板潃锛屽鏋滀粠鍏朵粬璁惧璁块棶闇�姹傦紙渚嬪鎵嬫満绔級锛岄渶瑕佸皢ip鍦板潃璁句负鐪熷疄鍏綉ip +```shell +cd funasr/runtime/html5 +python h5Server.py --host 0.0.0.0 --port 1337 +``` + +鍚姩鍚庯紝鍦ㄦ祻瑙堝櫒涓緭鍏ワ紙[https://127.0.0.1:1337/static/index.html](https://127.0.0.1:1337/static/index.html)锛夊嵆鍙闂� + +### c++ 鐗堟湰鏈嶅姟鍚姩 + +鐢变簬c++渚濊禆鐜杈冨锛屽缓璁噰鐢╠ocker閮ㄧ讲锛屾敮鎸佷竴閿惎鍔ㄦ湇鍔� + +```shell +curl -O https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/shell/funasr-runtime-deploy-offline-cpu-zh.sh; +sudo bash funasr-runtime-deploy-offline-cpu-zh.sh install --workspace /root/funasr-runtime-resources +``` +璇︾粏鍙傛暟閰嶇疆涓庤В鏋愶紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/blob/main/funasr/runtime/docs/SDK_tutorial_zh.md)锛� + + +## 瀹㈡埛绔祴璇� + +### 鏂瑰紡涓� + +html瀹㈡埛绔洿杩烇紝鎵嬪姩涓嬭浇瀹㈡埛绔紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/html5/static)锛夎嚦鏈湴锛屾墦寮�`index.html`缃戦〉锛岃緭鍏ss鍦板潃涓庣鍙e彿鍗冲彲浣跨敤 + +### 鏂瑰紡浜� + +html5鏈嶅姟绔紝鑷姩涓嬭浇瀹㈡埛绔嚦鏈湴锛屾敮鎸佹墜鏈虹瓑绔笂璁块棶锛宨p鍦板潃闇�瑕佷笌html5 server淇濇寔涓�鑷达紝濡傛灉鏄湰鍦版満鍣紝鍙互鐢�127.0.0.1 + + +```shell +https://127.0.0.1:1337/static/index.html +``` + +杈撳叆wss鍦板潃涓庣鍙e彿鍗冲彲浣跨敤 + + +## Acknowledge +1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR). +2. We acknowledge [AiHealthx](http://www.aihealthx.com/) for contributing the html5 demo. -- Gitblit v1.9.1