Update README.md
Browse files
README.md
CHANGED
|
@@ -1,77 +1,56 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
language:
|
| 4 |
-
- zh
|
| 5 |
-
metrics:
|
| 6 |
-
- accuracy
|
| 7 |
-
- cer
|
| 8 |
-
pipeline_tag: automatic-speech-recognition
|
| 9 |
-
tags:
|
| 10 |
-
- Paraformer
|
| 11 |
-
- FunASR
|
| 12 |
-
- ASR
|
| 13 |
-
---
|
| 14 |
-
## Introduce
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
```
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
```
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
- `
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
Input: wav formt file, support formats: `str, np.ndarray, List[str]`
|
| 58 |
-
|
| 59 |
-
Output: `List[str]`: recognition result
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
## Performance benchmark
|
| 65 |
-
|
| 66 |
-
Please ref to [benchmark](https://alibaba-damo-academy.github.io/FunASR/en/benchmark/benchmark_onnx_cpp.html)
|
| 67 |
-
|
| 68 |
-
## Citations
|
| 69 |
-
|
| 70 |
-
``` bibtex
|
| 71 |
-
@inproceedings{gao2022paraformer,
|
| 72 |
-
title={Paraformer: Fast and Accurate Parallel Transformer for Non-autoregressive End-to-End Speech Recognition},
|
| 73 |
-
author={Gao, Zhifu and Zhang, Shiliang and McLoughlin, Ian and Yan, Zhijie},
|
| 74 |
-
booktitle={INTERSPEECH},
|
| 75 |
-
year={2022}
|
| 76 |
-
}
|
| 77 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- zh
|
| 5 |
+
metrics:
|
| 6 |
+
- accuracy
|
| 7 |
+
- cer
|
| 8 |
+
pipeline_tag: automatic-speech-recognition
|
| 9 |
+
tags:
|
| 10 |
+
- Paraformer
|
| 11 |
+
- FunASR
|
| 12 |
+
- ASR
|
| 13 |
+
---
|
| 14 |
+
## Introduce
|
| 15 |
+
|
| 16 |
+
This repo cloned from https://huggingface.co/funasr/Paraformer-large
|
| 17 |
+
|
| 18 |
+
## Install funasr_onnx
|
| 19 |
+
|
| 20 |
+
```shell
|
| 21 |
+
pip install -U funasr_onnx
|
| 22 |
+
# For the users in China, you could install with the command:
|
| 23 |
+
# pip install -U funasr_onnx -i https://mirror.sjtu.edu.cn/pypi/web/simple
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Download the model
|
| 27 |
+
|
| 28 |
+
```shell
|
| 29 |
+
git clone https://huggingface.co/hoangus0303/paraformer-large-clone-from-funasr
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Inference with runtime
|
| 33 |
+
|
| 34 |
+
### Speech Recognition
|
| 35 |
+
#### Paraformer
|
| 36 |
+
```python
|
| 37 |
+
from funasr_onnx import Paraformer
|
| 38 |
+
|
| 39 |
+
model_dir = "./paraformer-large"
|
| 40 |
+
model = Paraformer(model_dir, batch_size=1, quantize=True)
|
| 41 |
+
|
| 42 |
+
wav_path = ['./funasr/paraformer-large/asr_example.wav']
|
| 43 |
+
|
| 44 |
+
result = model(wav_path)
|
| 45 |
+
print(result)
|
| 46 |
+
```
|
| 47 |
+
- `model_dir`: the model path, which contains `model.onnx`, `config.yaml`, `am.mvn`
|
| 48 |
+
- `batch_size`: `1` (Default), the batch size duration inference
|
| 49 |
+
- `device_id`: `-1` (Default), infer on CPU. If you want to infer with GPU, set it to gpu_id (Please make sure that you have install the onnxruntime-gpu)
|
| 50 |
+
- `quantize`: `False` (Default), load the model of `model.onnx` in `model_dir`. If set `True`, load the model of `model_quant.onnx` in `model_dir`
|
| 51 |
+
- `intra_op_num_threads`: `4` (Default), sets the number of threads used for intraop parallelism on CPU
|
| 52 |
+
|
| 53 |
+
Input: wav formt file, support formats: `str, np.ndarray, List[str]`
|
| 54 |
+
|
| 55 |
+
Output: `List[str]`: recognition result
|
| 56 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|