Upload folder using huggingface_hub
Browse files- .gitattributes +7 -0
- kit/model/campplus/avg_model.pt +3 -0
- kit/model/campplus_cn_common.bin +3 -0
- kit/model/speech_campplus_five_lre_16k/.gitattributes +34 -0
- kit/model/speech_campplus_five_lre_16k/README.md +118 -0
- kit/model/speech_campplus_five_lre_16k/campplus_five_lang_16k.pt +3 -0
- kit/model/speech_campplus_five_lre_16k/classifier_five_lang_16k.pt +3 -0
- kit/model/speech_campplus_five_lre_16k/configuration.json +18 -0
- kit/model/speech_campplus_five_lre_16k/examples/example_lre_cant_16k.wav +3 -0
- kit/model/speech_campplus_five_lre_16k/examples/example_lre_engl_16k.wav +3 -0
- kit/model/speech_campplus_five_lre_16k/examples/example_lre_japan_16k.wav +3 -0
- kit/model/speech_campplus_five_lre_16k/examples/example_lre_korean_16k.wav +3 -0
- kit/model/speech_campplus_five_lre_16k/examples/example_lre_mand_16k.wav +3 -0
- kit/model/speech_campplus_five_lre_16k/images/ding.png +3 -0
- kit/model/speech_campplus_five_lre_16k/images/structure.png +3 -0
- kit/model/wavlm_large_finetune.pth +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
kit/model/speech_campplus_five_lre_16k/examples/example_lre_cant_16k.wav filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
kit/model/speech_campplus_five_lre_16k/examples/example_lre_engl_16k.wav filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
kit/model/speech_campplus_five_lre_16k/examples/example_lre_japan_16k.wav filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
kit/model/speech_campplus_five_lre_16k/examples/example_lre_korean_16k.wav filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
kit/model/speech_campplus_five_lre_16k/examples/example_lre_mand_16k.wav filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
kit/model/speech_campplus_five_lre_16k/images/ding.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
kit/model/speech_campplus_five_lre_16k/images/structure.png filter=lfs diff=lfs merge=lfs -text
|
kit/model/campplus/avg_model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:07abeeb5150441995b51ea65c9ccc8feed78b33040012f1d2fad29a0e4f5b8d7
|
| 3 |
+
size 66210861
|
kit/model/campplus_cn_common.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3388cf5fd3493c9ac9c69851d8e7a8badcfb4f3dc631020c4961371646d5ada8
|
| 3 |
+
size 28036335
|
kit/model/speech_campplus_five_lre_16k/.gitattributes
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.db* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.ark* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
kit/model/speech_campplus_five_lre_16k/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tasks:
|
| 3 |
+
- speech-language-recognition
|
| 4 |
+
model_type:
|
| 5 |
+
- CAM++
|
| 6 |
+
domain:
|
| 7 |
+
- audio
|
| 8 |
+
frameworks:
|
| 9 |
+
- pytorch
|
| 10 |
+
backbone:
|
| 11 |
+
- CAM++
|
| 12 |
+
license: Apache License 2.0
|
| 13 |
+
language:
|
| 14 |
+
- cn
|
| 15 |
+
tags:
|
| 16 |
+
- speech language recognition
|
| 17 |
+
- CAM++
|
| 18 |
+
- 中英文语种识别
|
| 19 |
+
widgets:
|
| 20 |
+
- task: speech-language-recognition
|
| 21 |
+
model_revision: v1.0.1
|
| 22 |
+
inputs:
|
| 23 |
+
- type: audio
|
| 24 |
+
name: input
|
| 25 |
+
title: 音频
|
| 26 |
+
examples:
|
| 27 |
+
- name: 1
|
| 28 |
+
title: 示例1
|
| 29 |
+
inputs:
|
| 30 |
+
- name: input
|
| 31 |
+
data: git://examples/example_lre_mand_16k.wav
|
| 32 |
+
- name: 2
|
| 33 |
+
title: 示例2
|
| 34 |
+
inputs:
|
| 35 |
+
- name: input
|
| 36 |
+
data: git://examples/example_lre_engl_16k.wav
|
| 37 |
+
- name: 3
|
| 38 |
+
title: 示例3
|
| 39 |
+
inputs:
|
| 40 |
+
- name: input
|
| 41 |
+
data: git://examples/example_lre_japan_16k.wav
|
| 42 |
+
- name: 4
|
| 43 |
+
title: 示例3
|
| 44 |
+
inputs:
|
| 45 |
+
- name: input
|
| 46 |
+
data: git://examples/example_lre_cant_16k.wav
|
| 47 |
+
- name: 5
|
| 48 |
+
title: 示例3
|
| 49 |
+
inputs:
|
| 50 |
+
- name: input
|
| 51 |
+
data: git://examples/example_lre_korean_16k.wav
|
| 52 |
+
inferencespec:
|
| 53 |
+
cpu: 8 #CPU数量
|
| 54 |
+
memory: 1024
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
# CAM++识别模型
|
| 58 |
+
CAM++模型是基于密集连接时延神经网络的识别模型。相比于一些主流模型,比如ResNet34和ECAPA-TDNN,CAM++具有更准确的识别性能和更快的推理速度。该模型可以用于语种识别、说话人确认等多项任务。
|
| 59 |
+
## 模型简述
|
| 60 |
+
CAM++模型结构如下图所示,整个模型包含两部分,残差卷积网络作为前端,时延神经网络结构作为主干。前端模块是2维卷积结构,用于提取更加局部和精细的时频特征。主干模块采用密集型连接,复用层级特征,提高计算效率。同时每一层中嵌入了一个轻量级的上下文相关的掩蔽(Context-aware Mask)模块,该模块通过多粒度的pooling操作提取不同尺度的上下文信息,生成的mask可以去除掉特征中的无关噪声,并保留关键的信息。
|
| 61 |
+
|
| 62 |
+
<div align=center>
|
| 63 |
+
<img src="images/structure.png" width="400" />
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
更详细的信息见
|
| 67 |
+
- 论文:[CAM++: A Fast and Efficient Network for Speaker Verification Using Context-Aware Masking](https://arxiv.org/abs/2303.00332)
|
| 68 |
+
- github项目地址:[3D-Speaker](https://github.com/alibaba-damo-academy/3D-Speaker)
|
| 69 |
+
|
| 70 |
+
## 模型效果评估
|
| 71 |
+
在集外10s长的各语种识别准确率91%。
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
# 如何快速体验模型效果
|
| 75 |
+
## 在Notebook中体验
|
| 76 |
+
对于有开发需求的使用者,特别推荐您使用Notebook进行离线处理。先登录ModelScope账号,点击模型页面右上角的“在Notebook中打开”按钮出现对话框,首次使用会提示您关联阿里云账号,按提示操作即可。关联账号后可进入选择启动实例界面,选择计算资源,建立实例,待实例创建完成后进入开发环境,输入api调用实例。
|
| 77 |
+
``` python
|
| 78 |
+
from modelscope.pipelines import pipeline
|
| 79 |
+
lre_pipeline = pipeline(
|
| 80 |
+
task='speech-language-recognition',
|
| 81 |
+
model='damo/speech_campplus_five_lre_16k',
|
| 82 |
+
model_revision='v1.0.1'
|
| 83 |
+
)
|
| 84 |
+
example_wav = 'https://modelscope.cn/api/v1/models/damo/speech_eres2net_base_mej_lre_16k_common/repo?Revision=master&FilePath=examples/example_lre_mand_16k.wav'
|
| 85 |
+
# 识别语种
|
| 86 |
+
result = lre_pipeline(example_wav)
|
| 87 |
+
print(result)
|
| 88 |
+
```
|
| 89 |
+
## 训练和测试自己的CAM++语种模型
|
| 90 |
+
本项目已在[3D-Speaker](https://github.com/alibaba-damo-academy/3D-Speaker)开源了训练、测试和推理代码,使用者可按下面方式下载安装使用:
|
| 91 |
+
``` sh
|
| 92 |
+
git clone https://github.com/alibaba-damo-academy/3D-Speaker.git && cd 3D-Speaker
|
| 93 |
+
conda create -n 3D-Speaker python=3.8
|
| 94 |
+
conda activate 3D-Speaker
|
| 95 |
+
pip install -r requirements.txt
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
运行CAM++语种识别样例
|
| 99 |
+
``` sh
|
| 100 |
+
cd egs/3dspeaker/lid
|
| 101 |
+
# 需要在run.sh中提前配置训练使用的GPU信息,默认是4卡
|
| 102 |
+
bash run.sh
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
# 相关论文以及引用信息
|
| 106 |
+
如果你觉得这个该模型有所帮助,请引用下面的相关的论文
|
| 107 |
+
```BibTeX
|
| 108 |
+
@article{cam++,
|
| 109 |
+
title={CAM++: A Fast and Efficient Network for Speaker Verification Using Context-Aware Masking},
|
| 110 |
+
author={Hui Wang and Siqi Zheng and Yafeng Chen and Luyao Cheng and Qian Chen},
|
| 111 |
+
journal={arXiv preprint arXiv:2303.00332},
|
| 112 |
+
}
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
# 3D-Speaker 开发者社区钉钉群
|
| 116 |
+
<div align=left>
|
| 117 |
+
<img src="images/ding.png" width="260" />
|
| 118 |
+
</div>
|
kit/model/speech_campplus_five_lre_16k/campplus_five_lang_16k.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c344f0b70f9e50bd714289e15362e22435aa90c3cd2206403ff3a427f999928d
|
| 3 |
+
size 29396463
|
kit/model/speech_campplus_five_lre_16k/classifier_five_lang_16k.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:372b1048131cb5f978cafa391e8c4d4eaa992c174eaebbaecf972d1c4cd81388
|
| 3 |
+
size 11367
|
kit/model/speech_campplus_five_lre_16k/configuration.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"framework": "pytorch",
|
| 3 |
+
"task": "speech-language-recognition",
|
| 4 |
+
"model": {
|
| 5 |
+
"type": "cam++-lre",
|
| 6 |
+
"model_config": {
|
| 7 |
+
"sample_rate": 16000,
|
| 8 |
+
"fbank_dim": 80,
|
| 9 |
+
"emb_size": 512,
|
| 10 |
+
"languages": ["Cantonese", "English", "Japan", "Korean", "Chinese"]
|
| 11 |
+
},
|
| 12 |
+
"pretrained_encoder": "campplus_five_lang_16k.pt",
|
| 13 |
+
"pretrained_backend": "classifier_five_lang_16k.pt"
|
| 14 |
+
},
|
| 15 |
+
"pipeline": {
|
| 16 |
+
"type": "speech-language-recognition"
|
| 17 |
+
}
|
| 18 |
+
}
|
kit/model/speech_campplus_five_lre_16k/examples/example_lre_cant_16k.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04eb5d70e16cc77d6a16978ab3d4cfd3f748b61e06e6130f727506527d247ce2
|
| 3 |
+
size 319566
|
kit/model/speech_campplus_five_lre_16k/examples/example_lre_engl_16k.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15739b935e4c9e8b1385aaa02380f95f7b320356e8d0457c9b0097e45c170454
|
| 3 |
+
size 320020
|
kit/model/speech_campplus_five_lre_16k/examples/example_lre_japan_16k.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:775e503a90119cd98622db5f5742926010a3bdae14e1d792694ecc21d1f732c2
|
| 3 |
+
size 319566
|
kit/model/speech_campplus_five_lre_16k/examples/example_lre_korean_16k.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58a1658279911a938b50488c3781fcacc81f6ab34c4f315fb76a1178130539ef
|
| 3 |
+
size 319566
|
kit/model/speech_campplus_five_lre_16k/examples/example_lre_mand_16k.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d5427748c6c7b36eb27cdf76b68998453e2d814ab30d1c137151d834a31c71e
|
| 3 |
+
size 319566
|
kit/model/speech_campplus_five_lre_16k/images/ding.png
ADDED
|
Git LFS Details
|
kit/model/speech_campplus_five_lre_16k/images/structure.png
ADDED
|
Git LFS Details
|
kit/model/wavlm_large_finetune.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:51f07e3b94d9e0262a6a675ef5a087be3dd09e8c62e9d886827f44f82fe7f94b
|
| 3 |
+
size 1301926579
|