This tools download audios from youtube and execute diarization by speaker using pyannote-audio.
This project has been tested on Ubuntu 20.04.4 LTS. First, you need to install the FFmpeg program using the following command:
$ sudo apt update; apt install ffmpegTo create a conda environment from scratch, run the following commands
$ conda create -n youtube_diarization python=3.9 pipActivate the environment:
$ conda activate youtube_diarizationUse the package manager pip to install the requirements.
First, install speechbrain (torch is a requirement):
$ conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 -c pytorch
$ pip install speechbrainAfter, install pyannote-audio:
$ pip install https://github.com/pyannote/pyannote-audio/archive/develop.zipFinally, install other requirements:
$ pip install -r requirements.txtOr use the yml file:
$ conda env create -f environment.ymlCreate a youtube links file, one link for line:
$ cat input/links.txtYour file should look something like this:
# Yoshua Bengio interview
https://www.youtube.com/watch?v=Tzuhnuo8KQg
# Ian Goodfellow interview
https://www.youtube.com/watch?v=Z6rxFNMGdn0
# Andrew Ng interview
https://www.youtube.com/watch?v=0jspaMLxBig
# Geoffrey Hinton interview
https://www.youtube.com/watch?v=-eyhCTvrEtE
If the line starts with '#' it will be ignored.
For execution it is necessary to use a configuration file, such as the config.json file:
{
"youtube_list": "input/links.txt",
"videos_folder": "output/"
}
- youtube_list: input filepath containing the youtube links.
- videos_folder: output folder in which downloaded audios/videos will be segmented.
To execution, run the command:
$ python main.py -c config.json