Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model] Add Silero VAD example #1107

Merged
merged 29 commits into from
Jan 15, 2023
Merged

Conversation

chenqianhe
Copy link
Collaborator

PR types(PR类型)

Model

Description

增加 VAD 模型示例;支持cpp调用。
该模型主要用于检测语音的中无声部分和speak部分,并输出speak的时间段。
模型来源和详细介绍见:https://github.com/snakers4/silero-vad

该模型主要应用场景为端侧使用,且推理速度极快,一个音频窗口推理基本不超过1ms,因此仅实现了cpp推理。

Copy link
Collaborator

@DefTruth DefTruth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢您的贡献!可以第一次review的意见修改一下哈,等所有修改意见完成后,我们才能合入

examples/audio/silero-vad/cpp/Vad.cc Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/wav.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/wav.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/wav.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/Vad.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/wav.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/wav.h Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/Vad.cc Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/README.md Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/README_CN.md Show resolved Hide resolved
@chenqianhe
Copy link
Collaborator Author

@DefTruth 确认一个关于 wav.h 的整体问题哈,这个属于第三方的,也要去同步修改格式问题吗

@DefTruth
Copy link
Collaborator

DefTruth commented Jan 11, 2023

意思是这是一个从开源库里引用的是吗?可以注明下出处。如果影响使用的话,格式可以先不改。先修改其他的。

@chenqianhe
Copy link
Collaborator Author

Reference in new

有标注的来源的,在对应文件最开头就有声明

@DefTruth
Copy link
Collaborator

Reference in new

有标注的来源的,在对应文件最开头就有声明

好的

@chenqianhe
Copy link
Collaborator Author

model_and_example.zip

@chenqianhe
Copy link
Collaborator Author

@DefTruth 大部分已经修改完成,但是还有两个点不太明确。
一是成员变量末尾使用下划线进行标记。这个是所有成员变量都需要这样吗,区分 public 和 private 吗?
二是需要增加函数注释,说明函数的作用。目前来看,成员函数主要是两类,一类是getter,一类是功能实现函数,根据名称其实都比较明显能看出来作用,并且文档也给了所有功能函数的说明和参数解释。因此能否明确一下哪些需要补充函数注释,getter应该都不用了吧。

@DefTruth
Copy link
Collaborator

@DefTruth 大部分已经修改完成,但是还有两个点不太明确。 一是成员变量末尾使用下划线进行标记。这个是所有成员变量都需要这样吗,区分 public 和 private 吗? 二是需要增加函数注释,说明函数的作用。目前来看,成员函数主要是两类,一类是getter,一类是功能实现函数,根据名称其实都比较明显能看出来作用,并且文档也给了所有功能函数的说明和参数解释。因此能否明确一下哪些需要补充函数注释,getter应该都不用了吧。

关于一:所有成员都加下滑线吧,pubilc成员通过getter和setter获取或设置。关于二:作用明显的函数不加注释,这样处理也没问题。后续我们继续review下哈,感谢您的贡献~

@chenqianhe
Copy link
Collaborator Author

@DefTruth 大部分已经修改完成,但是还有两个点不太明确。 一是成员变量末尾使用下划线进行标记。这个是所有成员变量都需要这样吗,区分 public 和 private 吗? 二是需要增加函数注释,说明函数的作用。目前来看,成员函数主要是两类,一类是getter,一类是功能实现函数,根据名称其实都比较明显能看出来作用,并且文档也给了所有功能函数的说明和参数解释。因此能否明确一下哪些需要补充函数注释,getter应该都不用了吧。

关于一:所有成员都加下滑线吧,pubilc成员通过getter和setter获取或设置。关于二:作用明显的函数不加注释,这样处理也没问题。后续我们继续review下哈,感谢您的贡献~

@DefTruth done

@DefTruth
Copy link
Collaborator

@chenqianhe 这个wav.h的代码风格的CI一直没过,看看有没有可能在不影响使用的基础上修改?可以直接运行commit-prepare.sh后,再提交commit,应该会自动修正一些代码风格

@chenqianhe
Copy link
Collaborator Author

chenqianhe commented Jan 12, 2023

@chenqianhe 这个wav.h的代码风格的CI一直没过,看看有没有可能在不影响使用的基础上修改?可以直接运行commit-prepare.sh后,再提交commit,应该会自动修正一些代码风格

@DefTruth 本地已完成fix

@DefTruth
Copy link
Collaborator

@chenqianhe 这个wav.h的代码风格的CI一直没过,看看有没有可能在不影响使用的基础上修改?可以直接运行commit-prepare.sh后,再提交commit,应该会自动修正一些代码风格

@DefTruth 本地已完成fix

LSTM

@DefTruth
Copy link
Collaborator

@chenqianhe 模型和测试语音文件已经上传到以下地址:

https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad.tgz
https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad_sample.wav

请测试后,参考examples/vision/detection/yolov5的文档补充VAD的文档(提供可下载的模型链接,以及增加该开源库的开源协议说明)

image

对应的推理案例,需要修改成从链接下载模型和数据,然后infer_xxx model data 的方式

@chenqianhe
Copy link
Collaborator Author

这个我看过,主要是因为这个模型应用场景不会存在这种 infer_xxx model data 来直接获取输出的(比如获取分类结果就结束了),基本是一定需要后接其他处理的,这个模型主要是作为完整程序使用的一部分,因此我的示例是将 model 和 data 编码到 infer_xxx 中的。看看这里有必要改成支持命令行参数的吗

@DefTruth
Copy link
Collaborator

这个我看过,主要是因为这个模型应用场景不会存在这种 infer_xxx model data 来直接获取输出的(比如获取分类结果就结束了),基本是一定需要后接其他处理的,这个模型主要是作为完整程序使用的一部分,因此我的示例是将 model 和 data 编码到 infer_xxx 中的。看看这里有必要改成支持命令行参数的吗

如果不熟悉gflags的话,可以先参考以下这个案例的方式:

但整体上,我们还是保持:用户下载模型和案例文件 -> 编译demo -> 执行demo,并输入模型文件和数据 这样统一的方式

@chenqianhe
Copy link
Collaborator Author

https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad.tgz
https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad_sample.wav

done

@chenqianhe
Copy link
Collaborator Author

@chenqianhe 模型和测试语音文件已经上传到以下地址:

https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad.tgz
https://bj.bcebos.com/paddlehub/fastdeploy/silero_vad_sample.wav

请测试后,参考examples/vision/detection/yolov5的文档补充VAD的文档(提供可下载的模型链接,以及增加该开源库的开源协议说明)

image

对应的推理案例,需要修改成从链接下载模型和数据,然后infer_xxx model data 的方式

done

Copy link
Collaborator

@DefTruth DefTruth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还有些小问题需要修改,其他的暂时没有问题了。很赞的FD使用示例,后续我们会考虑将该案例移植到主库或移动端,感谢贡献 ~

examples/audio/silero-vad/cpp/README.md Show resolved Hide resolved
examples/audio/silero-vad/cpp/README.md Show resolved Hide resolved
examples/audio/silero-vad/cpp/README.md Outdated Show resolved Hide resolved
examples/audio/silero-vad/cpp/README_CN.md Show resolved Hide resolved
examples/audio/silero-vad/cpp/README_CN.md Outdated Show resolved Hide resolved
@chenqianhe
Copy link
Collaborator Author

还有些小问题需要修改,其他的暂时没有问题了。很赞的FD使用示例,后续我们会考虑将该案例移植到主库或移动端,感谢贡献 ~

@DefTruth done

@jiangjiajun jiangjiajun merged commit a4b94b2 into PaddlePaddle:develop Jan 15, 2023
DefTruth added a commit to DefTruth/FastDeploy that referenced this pull request Jan 15, 2023
* [Model] Support Insightface model inferenceing on RKNPU (PaddlePaddle#1113)

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* Update issues.md

* Update fastdeploy_init.sh

* 更新交叉编译

* 更新insightface系列模型的rknpu2支持

* 更新insightface系列模型的rknpu2支持

* 更新说明文档

* 更新insightface

* 尝试解决pybind问题

Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>

* [Other] Add Function For Aligning Face With Five Points (PaddlePaddle#1124)

* 更新5点人脸对齐的代码

* 更新代码格式

* 解决comment

* update example

* 更新注释

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

* [Lite] Support PaddleYOLOv8 with Lite Backend (PaddlePaddle#1145)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (PaddlePaddle#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (PaddlePaddle#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (PaddlePaddle#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (PaddlePaddle#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [YOLOv8] add PaddleYOLOv8 pybind11 (PaddlePaddle#1144) (#31)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (PaddlePaddle#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (PaddlePaddle#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (PaddlePaddle#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (PaddlePaddle#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [benchmark] add PaddleYOLOv8 -> benchmark

* [benchmark] add PaddleYOLOv8 -> benchmark

* [Lite] Support PaddleYOLOv8 with Lite Backend

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [Model] Add Silero VAD example (PaddlePaddle#1107)

* add vad example

* fix typo

* fix typo

* rename file

* remove model and wav

* delete Vad.cc

* delete Vad.h

* rename and format

* fix max and min

* update readme

* rename var

* format

* add params

* update readme

* update readme

* Update README.md

* Update README_CN.md

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

Co-authored-by: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com>
Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>
Co-authored-by: Qianhe Chen <54462604+chenqianhe@users.noreply.github.com>
DefTruth added a commit that referenced this pull request Jan 16, 2023
* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [YOLOv8] add PaddleYOLOv8 pybind11 (#1144) (#31)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [benchmark] add PaddleYOLOv8 -> benchmark

* [benchmark] add PaddleYOLOv8 -> benchmark

* [Lite] Support PaddleYOLOv8 with Lite Backend

* [Pick] Update from latest develop (#32)

* [Model] Support Insightface model inferenceing on RKNPU (#1113)

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* Update issues.md

* Update fastdeploy_init.sh

* 更新交叉编译

* 更新insightface系列模型的rknpu2支持

* 更新insightface系列模型的rknpu2支持

* 更新说明文档

* 更新insightface

* 尝试解决pybind问题

Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>

* [Other] Add Function For Aligning Face With Five Points (#1124)

* 更新5点人脸对齐的代码

* 更新代码格式

* 解决comment

* update example

* 更新注释

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

* [Lite] Support PaddleYOLOv8 with Lite Backend (#1145)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [YOLOv8] add PaddleYOLOv8 pybind11 (#1144) (#31)

* [Model] Support PaddleYOLOv8 model

* [YOLOv8] Add PaddleYOLOv8 pybind

* [Other] update from latest develop (#30)

* [Backend] Remove all lite options in RuntimeOption (#1109)

* Remove all lite options in RuntimeOption

* Fix code error

* move pybind

* Fix build error

* [Backend] Add TensorRT  FP16 support for AdaptivePool2d (#1116)

* add fp16 cuda kernel

* fix code bug

* update code

* [Doc] Fix KunlunXin doc (#1139)

fix kunlunxin doc

* [Model] Support PaddleYOLOv8 model (#1136)

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [benchmark] add PaddleYOLOv8 -> benchmark

* [benchmark] add PaddleYOLOv8 -> benchmark

* [Lite] Support PaddleYOLOv8 with Lite Backend

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>

* [Model] Add Silero VAD example (#1107)

* add vad example

* fix typo

* fix typo

* rename file

* remove model and wav

* delete Vad.cc

* delete Vad.h

* rename and format

* fix max and min

* update readme

* rename var

* format

* add params

* update readme

* update readme

* Update README.md

* Update README_CN.md

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>

Co-authored-by: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com>
Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>
Co-authored-by: Qianhe Chen <54462604+chenqianhe@users.noreply.github.com>

* [YOLOv8] Support PaddleYOLOv8 on Kunlunxin&Ascend

* [YOLOv8] Add PaddleYOLOv8 model download links

* [YOLOv8] Add PaddleYOLOv8 Box AP

Co-authored-by: Jason <jiangjiajun@baidu.com>
Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com>
Co-authored-by: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com>
Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Qianhe Chen <54462604+chenqianhe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants