Commit c2eb66ac authored by mayong's avatar mayong
Browse files

Merge branch 'main' of https://github.com/RapidAI/RapidASR

parents 67e8cd2f fb1be4c6
...@@ -13,31 +13,16 @@ ...@@ -13,31 +13,16 @@
- Python - Python
- C++/C - C++/C
#### 更新日志
- 2024-02-25
- 添加C++版本推理,使用onnxruntime引擎,预/后处理代码来自: https://github.com/chenkui164/FastASR
- 2023-02-14 v2.0.3 update:
- 修复librosa读取wav文件错误
- 修复fbank与torch下fbank提取结果不一致bug
- 2023-02-11 v2.0.2 update:
- 模型和推理代码解耦(`rapid_paraformer``resources`
- 支持批量推理(通过`resources/config.yaml``batch_size`指定)
- 增加多种输入方式(`Union[str, np.ndarray, List[str]]`
- 2023-02-10 v2.0.1 update:
- 添加对输入音频为噪音或者静音的文件推理结果捕捉。
#### 使用步骤 #### 使用步骤
1. 安装环境 1. 安装环境
```bash ```bash
pip install -r requirements.txt pip install -r requirements.txt
``` ```
2. 下载模型 2. 下载模型
- 由于模型太大(823.8M),上传到仓库不容易下载,提供百度云下载连接:[asr_paraformerv2.onnx](https://pan.baidu.com/s/1-nEf2eUpkzlcRqiYEwub2A?pwd=dcr3)(模型MD5: `9ca331381a470bc4458cc6c0b0b165de` - 由于模型太大(823.8M),上传到仓库不容易下载,
- (推荐)自助转换:基于modescope下的notebook环境,可一键转换,详情戳:[快速体验](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary)
- 打开notebook → Cell中输入`!python -m funasr.export.export_model 'damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch' "./export" true`, 执行即可。
- 提供百度云下载连接:[asr_paraformerv2.onnx](https://pan.baidu.com/s/1-nEf2eUpkzlcRqiYEwub2A?pwd=dcr3)(模型MD5: `9ca331381a470bc4458cc6c0b0b165de`
- 模型下载之后,放在`resources/models`目录下即可,最终目录结构如下: - 模型下载之后,放在`resources/models`目录下即可,最终目录结构如下:
```text ```text
. .
...@@ -87,3 +72,19 @@ ...@@ -87,3 +72,19 @@
['呃说不配合就不配合的好以上的话呢我们摘取八九十三条因为这三条的话呢比较典型啊一些数字比较明确尤其是时间那么我们要投资者就是了解这一点啊不要轻信这个市场可以快速回来啊这些配市公司啊后期又利好了可 ['呃说不配合就不配合的好以上的话呢我们摘取八九十三条因为这三条的话呢比较典型啊一些数字比较明确尤其是时间那么我们要投资者就是了解这一点啊不要轻信这个市场可以快速回来啊这些配市公司啊后期又利好了可
以快速快速攻能包括像前一段时间啊有些媒体在二三月份的时候'] 以快速快速攻能包括像前一段时间啊有些媒体在二三月份的时候']
``` ```
#### 更新日志
- 2024-02-25
- 添加C++版本推理,使用onnxruntime引擎,预/后处理代码来自: https://github.com/chenkui164/FastASR
- 2023-02-14 v2.0.3 update:
- 修复librosa读取wav文件错误
- 修复fbank与torch下fbank提取结果不一致bug
- 2023-02-11 v2.0.2 update:
- 模型和推理代码解耦(`rapid_paraformer``resources`
- 支持批量推理(通过`resources/config.yaml``batch_size`指定)
- 增加多种输入方式(`Union[str, np.ndarray, List[str]]`
- 2023-02-10 v2.0.1 update:
- 添加对输入音频为噪音或者静音的文件推理结果捕捉。
## 注意 ## 注意
本程序只支持 采样率16000hz, 位深16bit的 **单道** 音频。 本程序只支持 采样率16000hz, 位深16bit的 **单道** 音频。
## 快速使用 ## 快速使用
...@@ -42,9 +42,8 @@ tester /path/to/models/dir /path/to/wave/file ...@@ -42,9 +42,8 @@ tester /path/to/models/dir /path/to/wave/file
## 导出onnx格式模型文件 ## 导出onnx格式模型文件
安装 modelscope与FunASR,[安装文档](https://github.com/alibaba-damo-academy/FunASR/wiki) 安装 modelscope与FunASR,依赖:torch,torchaudio,安装过程[详细参考文档](https://github.com/alibaba-damo-academy/FunASR/wiki)
```shell ```shell
pip config set global.index-url https://mirror.sjtu.edu.cn/pypi/web/simple #推荐使用上交pip源
pip install "modelscope[audio_asr]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html pip install "modelscope[audio_asr]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
git clone https://github.com/alibaba/FunASR.git && cd FunASR git clone https://github.com/alibaba/FunASR.git && cd FunASR
pip install --editable ./ pip install --editable ./
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment