必须预先安装 ffmpeg,否则无法解码任意格式的音频;性别分类模型基于法语说话人训练,用于其他语言时效果可能下降;Tensorflow 尚不支持 Python 3.14+,需使用 3.8 至 3.13 的解释器。
inaSpeechSegmenter
ina-fossMIT更新放缓基于 CNN 的音频分割工具包,能自动切分语音、音乐和噪声片段,并识别说话人性别,适合大规模按性别统计发言时长的研究。
CNN-based audio segmentation toolkit. Allows to detect speech, music, noise and speaker gender. Has been designed for large scale gender equality studies based on speech time per gender.
sudo apt-get install ffmpeg
pip install inaSpeechSegmenterREADME 未说明显存或 GPU 型号要求,仅说明依赖 Tensorflow,支持 Python 3.8 至 3.13,不支持 Python 3.14+。
基于 CNN 的音频分割工具,把音频切成语音、音乐、噪声并标注说话人性别
基于 CNN 的音频分割工具包,能自动切分语音、音乐和噪声片段,并识别说话人性别,适合大规模按性别统计发言时长的研究。
核心能力
- 用 CNN 将音频切分为语音、音乐、噪声三类同质片段
- 对语音段按说话人性别标注 female 或 male
- 可选 vad_engine 在 smn 与 sm 两种 VAD 引擎间切换
- 输出 csv 与 Praat TextGrid 两种分割格式
- 提供 Segmenter 类 API 与命令行工具两种用法
容易踩的坑
- interspeech23最新正式版2023-03-30 · 2023-03-30 13:58 UTC
-
final.onnx and raw81.pth are pretrained X-vector Resnet101 architectures, obtained from VBX project (Brno University of Technology) https://github.com/BUTSpeechFIT/VBx/tree/master/VBx/models/ResNet101_16kHz/nnet For more details see F. Landini, J. Profant, M. Diez, L. Burget: Bayesian HMM clustering of x-vector sequences (VBx) in speaker diarization: theory, implementation and analysis on standard tasks (arXiv version)
-
interspeech2023_all.hdf5 and interspeech2023_cvfr.hdf5 are X-vector MLP gender classification models trained by @simonD3V . This work is described in a study submitted to interspeech 2023 to be described upon acceptance.
-
- models2022-02-13 · 2022-02-13 13:46 UTC
查看更新说明
Classification models used in inaSpeechSegmenter
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
inaSpeechSegmenter
inaSpeechSegmenter is a CNN-based audio segmentation toolkit suited to the tasks of Voice Activity Detection and Speaker Gender Segmentation.
It splits audio signals into homogeneous zones of speech, music and noise. Speech zones are split into segments tagged using speaker gender (male or female). Male and female classification models are optimized for French language since they were trained using French speakers (acoustic correlates of speaker gender are language dependent). Zones corresponding to speech over music or speech over noise are tagged as speech. Singing voice is tagged as music.
Highlights
- :trophy: ranked #1 against 6 open-source VAD system on a French TV and radio benchmark
- :transgender_flag: Extended as a non-binary Voice Gender Prediction system for evaluating Transgender voice transition
- :sunglasses: Used since 2020 in the annual French Audivisual Regulation Authority report on women representation in TV and radio!
- :star2: Used to investigate the relationship between manual and automatic women representation descriptors in French TV and radio
- :female_sign: :male_sign: Applied for large-scale gender representation studies in French TV and radio.
- :partying_face: Won MIREX 2018 speech detection challenge.
Installation
inaSpeechSegmenter works with Python 3.8 to Python 3.13. It is based on Tensorflow which does not yet support Python 3.14+.
It is available on Python Package Index inaSpeechSegmenter and packaged as a docker image inafoss/inaspeechsegmenter.
Prerequisites
inaSpeechSegmenter requires ffmpeg for decoding any type of format. Installation of ffmpeg for ubuntu can be done using the following commandline:
$ sudo apt-get install ffmpeg
PIP installation
# create a python 3 virtual environment and activate it
$ python -m venv env
$ source env/bin/activate
# install framework and dependencies
$ pip install inaSpeechSegmenter
Installing from from sources
# clone git repository
$ git clone https://github.com/ina-foss/inaSpeechSegmenter.git
# create a python 3 virtual environment and activate it
$ python -m venv env
$ source env/bin/activate
# install framework and dependencies
# you should use pip instead of setup.py for installing from source
$ cd inaSpeechSegmenter
$ pip install .
# check program behavior
$ python setup.py test
Using inaSpeechSegmenter
Command-Line Interface
Binary program ina_speech_segmenter.py may be used to segment multimedia archives encoded in any format supported by ffmpeg. It requires input media and provide 2 segmentation output formats : csv (can be displayed with Sonic Visualiser) and TextGrid (Praat format). Detailed command line options can be obtained using the following command :
# get help
$ ina_speech_segmenter.py --help
Application Programming Interface
InaSpeechSegmentation API is intended to be very simple to use, and is illustrated by these 2 notebooks :
- Google colab tutorial: use API online
- Jupyter notebook tutorial : to be used offline
The class allowing to perform segmentations is called Segmenter. It is the only class that you need to import in a program. Class constructor accept 3 optional arguments:
- vad_engine (default: 'smn'). Allows to choose between 2 voice activity detection engines.
- 'smn' is the more recent engine and splits signal into speech, music and noise segments
- 'sm' was not trained with noise examples, and split signal into speech and music segments. Noise segments are either considered as speech or music. This engine was used in ICASSP study, and won MIREX 2018 speech detection challenge.
- detect_gender (default: True): if set to True, performs gender segmentation on speech segment and outputs labels 'female' or 'male'. Otherwise, outputs labels 'speech' (faster).
- ffmpeg: allows to provide a specific binary of ffmpeg instead of default system installation
Citing
inaSpeechSegmenter has been presented at the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) 2018 conference in Calgary, Canada. If you use this toolbox in your research, you can cite the following work in your publications :
@inproceedings{ddoukhanicassp2018,
author = {Doukhan, David and Carrive, Jean and Vallet, Félicien and Larcher, Anthony and Meignier, Sylvain},
title = {An Open-Source Speaker Gender Detection Framework for Monitoring Gender Equality},
year = {2018},
organization={IEEE},
booktitle={Acoustics Speech and Signal Processing (ICASSP), 2018 IEEE International Conference on}
}
inaSpeechSegmenter was ranked #1 against 6 open-source VAD system on a French TV and radio benchmark : LIUM_SpkDiarization, Pyannote, Rvad, Silero, Speechbrain
@inproceedings{doukhan-etal-2024-inagvad,
title = "{I}na{GVAD} : A Challenging {F}rench {TV} and Radio Corpus Annotated for Speech Activity Detection and Speaker Gender Segmentation",
author = "Doukhan, David and Maertens, Christine and Le Personnic, William and Speroni, Ludovic and Dehak, Reda",
booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
month = may,
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lrec-main.785/",
pages = "8963--8974",
}
inaSpeechSegmenter won MIREX 2018 speech detection challenge Details on the speech detection submodule can be found below:
@inproceedings{ddoukhanmirex2018,
author = {Doukhan, David and Lechapt, Eliott and Evrard, Marc and Carrive, Jean},
title = {INA’S MIREX 2018 MUSIC AND SPEECH DETECTION SYSTEM},
year = {2018},
booktitle={Music Information Retrieval Evaluation eXchange (MIREX 2018)}
}
Sibling Projects
- inaFaceAnalyzer : a Python toolbox for large-scale face-based description of gender representation in media with limited gender, racial and age biases
- inaGVAD : a Challenging French TV and Radio Corpus annotated for Voice Activity Detection and Speaker Gender Segmentation
CREDITS
This work has been partially funded by the French National Research Agency (project GEM : Gender Equality Monitor : ANR-19-CE38-0012) and by European Union's Horizon 2020 research and innovation programme (project MeMAD : H2020 grant agreement No 780069).
The code used to extract mel bands features is copy-pasted from SIDEKIT project
Relevant contributions to the project were done by: