speaker diarization coreml
Overview
Highlights
- Optimized for Apple Neural Engine and on-device execution
- Efficient speaker segmentation and identity clustering
- Low-latency processing for privacy-focused local applications
- Reduced battery consumption via CoreML hardware acceleration
- Open CC-BY-4.0 license for flexible commercial integration
Usage
# Install Hugging Face transformers
pip install transformers torch
# Load model with transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("FluidInference/speaker-diarization-coreml")
tokenizer = AutoTokenizer.from_pretrained("FluidInference/speaker-diarization-coreml")
Hugging Face Download
We recommend downloading the model via the Hugging Face CLI or Hub SDK.
Guidance:Before downloading, install huggingface_hub with:
pip install -U huggingface_hub
CLI Download
Download the full repository
huggingface-cli download FluidInference/speaker-diarization-coreml
Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download FluidInference/speaker-diarization-coreml config.json --local-dir ./dir
See the official docs for more CLI options
SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('FluidInference/speaker-diarization-coreml')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://huggingface.co/FluidInference/speaker-diarization-coreml
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/FluidInference/speaker-diarization-coreml
Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.
PyTorch / Transformers Usage
Install Transformers
pip install -U transformers torch
Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('FluidInference/speaker-diarization-coreml')
tokenizer = AutoTokenizer.from_pretrained('FluidInference/speaker-diarization-coreml')
Full Documentation
---
license: cc-by-4.0
tags:
- speech
- audio
- voice
- speaker-diarization
- speaker-change-detection
- coreml
- speaker-segmentation
base_model:
- pyannote/speaker-diarization-community-1
base_model_relation: finetune
pipeline_tag: voice-activity-detection
---
<span style="color:#5DAF8D">🧃 Speaker Diarization CoreML </span>
 Speaker diarization based on pyannote models optimized for Apple Neural Engine.
Models are trained on acoustic signatures so it supports any lanugage.
Usage
See the SDK for more details https://github.com/FluidInference/FluidAudio
Please note that the SDK itself is Apache 2.0, but the parent model from Pyannote is cc-by-4.0
Technical Specifications
- Input: 16kHz mono audio
- Output: Speaker segments with timestamps and IDs
- Framework: CoreML (converted from PyTorch)
- Optimization: Apple Neural Engine (ANE) optimized operations
- Precision: FP32 on CPU/GPU, FP16 on ANE
Performance
See the origianl model for detailed DER benchmark, for the purpose of our conversion, we tried to match the original model as much as possible:
The models on CoreML exhibit a ~10x Speedup on CPU and ~20x speed up on GPU.
Due to different precisions, there are minor differences in the values generated but the differences are mostly negilible, though it does account for some errors that needs to be adjusted during clustering:
We see this when running the end to end pipeline with the Pytorch model versus the Core ML model (patched the Pyannote pipeline to run the Core ML model instead). The DER and JER is ~1% compared to the Pytorch model as we're dropping the precision to fp32
!plots/pipeline_overview.png
Citations (from original model)
1. Speaker segmentation model
@inproceedings{Plaquet23,
author={Alexis Plaquet and Hervé Bredin},
title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
year=2023,
booktitle={Proc. INTERSPEECH 2023},
}2. Speaker embedding model
@inproceedings{Wang2023,
title={Wespeaker: A research and production oriented speaker embedding learning toolkit},
author={Wang, Hongji and Liang, Chengdong and Wang, Shuai and Chen, Zhengyang and Zhang, Binbin and Xiang, Xu and Deng, Yanlei and Qian, Yanmin},
booktitle={ICASSP 2023, IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
pages={1--5},
year={2023},
organization={IEEE}
}3. Speaker clustering
```bibtex
@article{Landini2022,
author={Landini, Federico and Profant, J{\'a}n and Diez, Mireia and Burget, Luk{\'a}{\v{s}}},
title={{Bayesian HMM clustering of x-vector sequences (VBx) in speaker diarization: theory, implementation and analysis on standard tasks}},
year={2022},
journal={Computer Speech \& Language},
}