MahmoudAshraf97/whisper-diarization

★ 5,646⑂ 0

Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper

About MahmoudAshraf97/whisper-diarization

MahmoudAshraf97/whisper-diarization is an open-source project on GitHub, mainly written in Jupyter Notebook. Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper It currently holds 5,646 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Audio Projects board and on the AI AI Audio Projects list.

GitHub Repository Details

Repository MahmoudAshraf97/whisper-diarization · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

Speaker Diarization Using OpenAI Whisper

FreePalestine.Dev

https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/Build Status https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/GitHub stars https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/GitHub issues https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/GitHub license https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/Twitter https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/Open in Colab

https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/MahmoudAshraf97%2Fwhisper-diarization | #9 Repository of the day

Speaker Diarization pipeline based on OpenAI Whisper

https://github.com/MahmoudAshraf97/whisper-diarization/blob/HEAD/drawing Please, star the project on github (see top-right corner) if you appreciate my contribution to the community!

What is it

This repository combines Whisper ASR capabilities with Voice Activity Detection (VAD) and Speaker Embedding to identify the speaker for each sentence in the transcription generated by Whisper. First, the vocals are extracted from the audio to increase the speaker embedding accuracy, then the transcription is generated using Whisper, then the timestamps are corrected and aligned using ctc-forced-aligner to help minimize diarization error due to time shift. The audio is then passed into MarbleNet for VAD and segmentation to exclude silences, TitaNet is then used to extract speaker embeddings to identify the speaker for each segment, the result is then associated with the timestamps generated by ctc-forced-aligner to detect the speaker for each word based on timestamps and then realigned using punctuation models to compensate for minor time shifts.

Whisper and NeMo parameters are coded into diarize.py and helpers.py, I will add the CLI arguments to change them later

Installation

Python >= 3.10 is needed, 3.9 will work but you'll need to manually install the requirements one by one.

FFMPEG and Cython are needed as prerequisites to install the requirements

pip install cython
or
sudo apt update && sudo apt install cython3
# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

on Arch Linux

sudo pacman -S ffmpeg

on MacOS using Homebrew (https://brew.sh/)

brew install ffmpeg

on Windows using Chocolatey (https://chocolatey.org/)

choco install ffmpeg

on Windows using Scoop (https://scoop.sh/)

scoop install ffmpeg

on Windows using WinGet (https://github.com/microsoft/winget-cli)

winget install ffmpeg
pip install -c constraints.txt -r requirements.txt

Usage

python diarize.py -a AUDIO_FILE_NAME

If your system has enough VRAM (>=10GB), you can use diarize_parallel.py instead, the difference is that it runs NeMo in parallel with Whisper, this can be beneficial in some cases and the result is the same since the two models are nondependent on each other. This is still experimental, so expect errors and sharp edges. Your feedback is welcome.

Command Line Options

Known Limitations

Future Improvements

Acknowledgements

Special Thanks for @adamjonas for supporting this project This work is based on OpenAI's Whisper , Faster Whisper , Nvidia NeMo , and Facebook's Demucs

Citation

If you use this in your research, please cite the project:
@unpublished{hassouna2024whisperdiarization,
  title={Whisper Diarization: Speaker Diarization Using OpenAI Whisper},
  author={Ashraf, Mahmoud},
  year={2024}
}

GitHub Stars & Activity

5,646Stars
0Forks
0Open issues
Jupyter NotebookLanguage

GitHub Popularity

GitHub stars5,646
Forks0
Open issues0
Primary languageJupyter Notebook
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

alphacep / vosk-api

Jupyter Notebook★ 15,130⑂ 0
2

NVIDIA / DeepLearningExamples

Jupyter Notebook★ 14,843⑂ 0
3

mozilla / TTS

Jupyter Notebook★ 10,173⑂ 0
4

MITDeepLearning / introtodeeplearning

Jupyter Notebook★ 8,783⑂ 0
5

snakers4 / silero-models

Jupyter Notebook★ 6,108⑂ 0
6

sanchit-gandhi / whisper-jax

Jupyter Notebook★ 4,680⑂ 0
7

Camb-ai / MARS5-TTS

Jupyter Notebook★ 2,820⑂ 0
8

huggingface / transformers

Python★ 166,221⑂ 0

More AI Rankings