閃光 (senkō) - a flash of light
A very fast and accurate speaker diarization pipeline.
1 hour of audio processed in 5 seconds (RTX 4090 + Ryzen 9 7950X).
On Apple M3, 1 hour in 7.7 seconds.
The pipeline achieves a best score of 13.5% DER on VoxConverse, 13.3% on AISHELL-4, and 26.5% on AMI-IHM. See the evaluation directory for more benchmarks and comparison with other diarization systems.
Senko powers the Zanshin media player.
import senko
diarizer = senko.Diarizer(device='auto', warmup=True, quiet=False)
wav_path = 'audio.wav' # 16kHz mono 16-bit wav
result = diarizer.diarize(wav_path, generate_colors=False)
senko.save_json(result["merged_segments"], 'audio_diarized.json')
senko.save_rttm(result["merged_segments"], wav_path, 'audio_diarized.rttm')
See examples/diarize.py for an interactive script, and also read DOCS.md
Senko can also be used in a notebook, like Google Colab and Modal Notebooks.
The following instructions are for Linux, macOS, and WSL. For Windows, see WINDOWS.md.
Prerequisites:
gcc/clang - on Linux/WSL, a separate install; on macOS, have the Xcode Command Line Tools installeduvCreate a Python virtual environment and activate it
uv venv --python 3.13 .venv
source .venv/bin/activate
Then install Senko
# For NVIDIA GPUs with CUDA compute capability >= 7.5 (~GTX 16 series and newer)
uv pip install "git+https://github.com/narcotic-sh/senko.git[nvidia]"
# For NVIDIA GPUs with CUDA compute capability < 7.5 (~GTX 10 series and older)
uv pip install "git+https://github.com/narcotic-sh/senko.git[nvidia-old]"
# For Mac (macOS 14+) and CPU execution on all other platforms
uv pip install "git+https://github.com/narcotic-sh/senko.git"
For NVIDIA, make sure the installed driver is CUDA 12 capable (should see CUDA Version: 12+ in nvidia-smi).
Senko is also available on PyPI, thanks to @gaspardpetit.
For setting up Senko for development, see DEV_SETUP.md.
See the evaluation directory.
Senko is a heavily optimized and slightly modified version of the speaker diarization pipeline found in the excellent 3D-Speaker project. It consists of four stages: VAD (voice activity detection), Fbank feature extraction, speaker embeddings generation, and clustering (spectral or UMAP+HDBSCAN).
The following modifications have been made:
On Linux/WSL, both Pyannote segmentation-3.0 and CAM++ run using PyTorch, but on Mac, both models run through CoreML. The CAM++ CoreML conversion was done from scratch in this project (see tracing/coreml), but the segmentation-3.0 converted model and interfacing code is taken from the excellent FluidAudio project by Fluid Inference.
| Application | Description |
|---|---|
| reaper_speech_diarizer | Split a downmixed voice recording into separate tracks for each speaker in REAPER DAW |
| scribe | Produce speaker-attributed transcripts using parakeet-mlx and Senko |
| verbatim | High quality multilingual speech to text with diarization |
Create a PR or message on Discord if you'd like your application that uses Senko added here too.
Identify Speakers. Then, after you add a media item, click on it and on the player page press the H key. In the textbox that appears, paste the contents of the output JSON file that examples/diarize.py generates.
cpu)?device=cuda, all parts of the pipeline run on the GPU, so long as the NVIDIA card has CUDA compute capability ≥ 7.0 (~GTX 16 series and newer); otherwise clustering falls back to the CPU.
device=cuda, everything except fbank extraction and clustering run on the GPU.
If you run into Numba related errors after upgrading/downgrading the numba package or other packages that use it (umap-learn, pynndescent, etc.), they might be caused by failed Numba cache invalidation. In such a case, clear the cache manually like so:
rm -rf ~/.cache/senko
Such errors may also appear if you have Zanshin installed, with different package versions installed in its Python environment compared to the development venv that you're using for Senko.
Join the Discord server to ask questions, suggest features, talk about Senko and Zanshin development etc.
torch.compile()Python
58.0%
C++
21.3%
Swift
18.4%
CMake
1.4%
閃光 (senkō) - a flash of light
A very fast and accurate speaker diarization pipeline.
1 hour of audio processed in 5 seconds (RTX 4090 + Ryzen 9 7950X).
On Apple M3, 1 hour in 7.7 seconds.
The pipeline achieves a best score of 13.5% DER on VoxConverse, 13.3% on AISHELL-4, and 26.5% on AMI-IHM. See the evaluation directory for more benchmarks and comparison with other diarization systems.
Senko powers the Zanshin media player.
import senko
diarizer = senko.Diarizer(device='auto', warmup=True, quiet=False)
wav_path = 'audio.wav' # 16kHz mono 16-bit wav
result = diarizer.diarize(wav_path, generate_colors=False)
senko.save_json(result["merged_segments"], 'audio_diarized.json')
senko.save_rttm(result["merged_segments"], wav_path, 'audio_diarized.rttm')
See examples/diarize.py for an interactive script, and also read DOCS.md
Senko can also be used in a notebook, like Google Colab and Modal Notebooks.
The following instructions are for Linux, macOS, and WSL. For Windows, see WINDOWS.md.
Prerequisites:
gcc/clang - on Linux/WSL, a separate install; on macOS, have the Xcode Command Line Tools installeduvCreate a Python virtual environment and activate it
uv venv --python 3.13 .venv
source .venv/bin/activate
Then install Senko
# For NVIDIA GPUs with CUDA compute capability >= 7.5 (~GTX 16 series and newer)
uv pip install "git+https://github.com/narcotic-sh/senko.git[nvidia]"
# For NVIDIA GPUs with CUDA compute capability < 7.5 (~GTX 10 series and older)
uv pip install "git+https://github.com/narcotic-sh/senko.git[nvidia-old]"
# For Mac (macOS 14+) and CPU execution on all other platforms
uv pip install "git+https://github.com/narcotic-sh/senko.git"
For NVIDIA, make sure the installed driver is CUDA 12 capable (should see CUDA Version: 12+ in nvidia-smi).
Senko is also available on PyPI, thanks to @gaspardpetit.
For setting up Senko for development, see DEV_SETUP.md.
See the evaluation directory.
Senko is a heavily optimized and slightly modified version of the speaker diarization pipeline found in the excellent 3D-Speaker project. It consists of four stages: VAD (voice activity detection), Fbank feature extraction, speaker embeddings generation, and clustering (spectral or UMAP+HDBSCAN).
The following modifications have been made:
On Linux/WSL, both Pyannote segmentation-3.0 and CAM++ run using PyTorch, but on Mac, both models run through CoreML. The CAM++ CoreML conversion was done from scratch in this project (see tracing/coreml), but the segmentation-3.0 converted model and interfacing code is taken from the excellent FluidAudio project by Fluid Inference.
| Application | Description |
|---|---|
| reaper_speech_diarizer | Split a downmixed voice recording into separate tracks for each speaker in REAPER DAW |
| scribe | Produce speaker-attributed transcripts using parakeet-mlx and Senko |
| verbatim | High quality multilingual speech to text with diarization |
Create a PR or message on Discord if you'd like your application that uses Senko added here too.
Identify Speakers. Then, after you add a media item, click on it and on the player page press the H key. In the textbox that appears, paste the contents of the output JSON file that examples/diarize.py generates.
cpu)?device=cuda, all parts of the pipeline run on the GPU, so long as the NVIDIA card has CUDA compute capability ≥ 7.0 (~GTX 16 series and newer); otherwise clustering falls back to the CPU.
device=cuda, everything except fbank extraction and clustering run on the GPU.
If you run into Numba related errors after upgrading/downgrading the numba package or other packages that use it (umap-learn, pynndescent, etc.), they might be caused by failed Numba cache invalidation. In such a case, clear the cache manually like so:
rm -rf ~/.cache/senko
Such errors may also appear if you have Zanshin installed, with different package versions installed in its Python environment compared to the development venv that you're using for Senko.
Join the Discord server to ask questions, suggest features, talk about Senko and Zanshin development etc.
torch.compile()Python
58.0%
C++
21.3%
Swift
18.4%
CMake
1.4%