Skip to content

Commit 4f25d27

Browse files
authored
Merge pull request #8 from FoxNoseTech/fix/speaker-count-clustering
chore: prepare 0.1.2 release
2 parents 77a4684 + 580e9a8 commit 4f25d27

9 files changed

Lines changed: 635 additions & 35 deletions

File tree

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ for seg in result.segments:
2323
print(f" [{seg.start:.1f}s - {seg.end:.1f}s] {seg.speaker}")
2424
```
2525

26-
**~5.0% weighted DER** on VoxConverse dev. Processes audio **~8x faster than real-time** on CPU. Automatically detects the number of speakers.
26+
**~4.8% weighted DER** on VoxConverse dev. Processes audio **~8x faster than real-time** on CPU. Automatically detects the number of speakers.
2727

28-
> Benchmarked on a single dataset ([VoxConverse](https://github.com/joonson/voxconverse)). Cross-dataset validation is [in progress](#roadmap).
28+
> Primary benchmark: [VoxConverse](https://github.com/joonson/voxconverse). Preliminary AMI meeting-domain validation is [in progress](#roadmap).
2929
3030
## How diarize compares
3131

@@ -35,7 +35,7 @@ for seg in result.segments:
3535
| GPU required | No | No (7x slower on CPU) | No |
3636
| HuggingFace account | No | Yes | Yes |
3737
| Auto speaker count | Yes | Yes | Yes |
38-
| DER (VoxConverse dev) | **~5.0%** | ~11.2% | ~8.5% |
38+
| DER (VoxConverse dev) | **~4.8%** | ~11.2% | ~8.5% |
3939
| CPU speed (RTF) | **0.12** | 0.86 ||
4040
| Install | `pip install diarize` | `pip install pyannote.audio` | `pip install pyannote.audio` |
4141

@@ -102,7 +102,7 @@ Evaluated on [VoxConverse](https://github.com/joonson/voxconverse) dev set (216
102102
| System | Weighted DER | Notes |
103103
|--------|----------|-------|
104104
| pyannote precision-2 | ~8.5% | Commercial license |
105-
| **diarize** | **~5.0%** | **Apache 2.0, CPU-only, no API key** |
105+
| **diarize** | **~4.8%** | **Apache 2.0, CPU-only, no API key** |
106106
| pyannote community-1 | ~11.2% | CC-BY-4.0, needs HF token |
107107
| pyannote 3.1 (legacy) | ~11.2% | MIT, needs HF token |
108108

@@ -111,26 +111,36 @@ Evaluated on [VoxConverse](https://github.com/joonson/voxconverse) dev set (216
111111
| Metric | Result |
112112
|--------|--------|
113113
| Files | 216 |
114-
| Exact match | 117/216 (54%) |
115-
| Within ±1 | 175/216 (81%) |
114+
| Exact match | 125/216 (58%) |
115+
| Within ±1 | 178/216 (82%) |
116116

117117
Many-speaker files remain the weak spot: automatic count estimation degrades above 7 speakers. Pass `num_speakers` when the count is known.
118118

119+
Preliminary AMI meeting-domain check (16 Mix-Headset test files, 4–9 speakers):
120+
121+
| Metric | Result |
122+
|--------|--------|
123+
| Weighted DER | 14.96% |
124+
| Speaker count exact match | 4/16 (25%) |
125+
| Speaker count within ±1 | 8/16 (50%) |
126+
127+
AMI confirms that meeting-domain speaker counting is harder: the estimator often collapses 6+ speaker meetings to 4–5 speakers.
128+
119129
Full benchmark results, speed comparison, and methodology: [benchmarks](https://foxnosetech.github.io/diarize/benchmarks/).
120130

121131
## When to use something else
122132

123-
- **You need commercial support or cross-dataset validation.** pyannote's commercial model has published production-oriented benchmarks beyond this single VoxConverse evaluation. If accuracy is the top priority and you have budget, compare on your own data.
133+
- **You need commercial support or broad cross-dataset validation.** pyannote's commercial model has published production-oriented benchmarks beyond this limited VoxConverse/AMI evaluation. If accuracy is the top priority and you have budget, compare on your own data.
124134
- **You need very stable speaker labels in transcripts.** Temporal smoothing reduces short label jumps, but diarize can still show speaker fragmentation / label switching: one real speaker may be split across multiple `SPEAKER_XX` labels, especially on noisy real-world audio.
125135
- **Your audio has 8+ speakers.** Automatic speaker count estimation degrades above 7 speakers. You can pass `num_speakers` explicitly, but test carefully.
126136
- **You need overlapping speech detection.** diarize assigns each segment to one speaker. Overlapping speech is not modeled.
127137
- **You need GPU-accelerated throughput.** diarize is CPU-only by design. For processing thousands of hours with GPU infrastructure, NeMo or pyannote on GPU will be faster.
128138

129139
## Roadmap
130140

131-
Current benchmarks are based on VoxConverse dev set only. We are actively working on:
141+
Current benchmarks include VoxConverse dev and preliminary AMI test validation. We are actively working on:
132142

133-
- **Cross-dataset validation**AMI, DIHARD III, CALLHOME, and other standard benchmarks in isolated environments
143+
- **Cross-dataset validation** — DIHARD III, CALLHOME, and other standard benchmarks in isolated environments
134144
- **Speaker count estimation benchmarks** — comparison of speaker counting accuracy against other systems
135145
- **Broader system comparison** — NeMo, WhisperX, and other diarization solutions
136146
- **Streaming / real-time diarization** — live audio streams with real-time speaker detection

docs/benchmarks.md

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Benchmarks
22

3-
Evaluated on the [VoxConverse](https://github.com/joonson/voxconverse)
4-
dev set (216 files, 1--20 speakers per file).
3+
Primary published numbers are evaluated on the
4+
[VoxConverse](https://github.com/joonson/voxconverse) dev set
5+
(216 files, 1--20 speakers per file). We also run preliminary
6+
cross-dataset checks on AMI meetings to track generalisation.
57

68
## Speaker Count Estimation
79

810
| Metric | Result |
911
|--------|--------|
1012
| Files | 216 |
11-
| Exact match | 117/216 (54%) |
12-
| Within +/-1 | 175/216 (81%) |
13+
| Exact match | 125/216 (58%) |
14+
| Within +/-1 | 178/216 (82%) |
1315

1416
The automatic estimator is usually close, but exact counting remains the
1517
main weak spot. Accuracy drops for many-speaker files --- see
@@ -23,21 +25,42 @@ DER is the standard metric for speaker diarization, computed with
2325
| System | Weighted DER | Median DER | Notes |
2426
|--------|----------|------------|-------|
2527
| pyannote precision-2 | ~8.5% | -- | Commercial license |
26-
| **diarize** | **~5.0%** | **~2.2%** | **Apache 2.0, CPU-only, no API key** |
28+
| **diarize** | **~4.8%** | **~2.1%** | **Apache 2.0, CPU-only, no API key** |
2729
| pyannote community-1 | ~11.2% | -- | CC-BY-4.0, needs HF token |
2830
| pyannote 3.1 (legacy) | ~11.2% | -- | MIT, needs HF token |
2931

3032
pyannote DER numbers are self-reported from the
3133
[pyannote benchmark page](https://huggingface.co/pyannote/speaker-diarization-3.1)
3234
on VoxConverse v0.3.
3335

34-
!!! note "VoxConverse-only result"
36+
!!! note "Dataset-specific result"
3537
On this VoxConverse dev evaluation, `diarize` reports lower weighted
3638
DER than the published pyannote VoxConverse figures, while requiring
3739
no HuggingFace token or account registration. Treat this as a
38-
single-dataset benchmark and compare on your own audio when accuracy
40+
VoxConverse-specific benchmark and compare on your own audio when accuracy
3941
is the top priority.
4042

43+
## Cross-Dataset Check: AMI
44+
45+
Preliminary AMI test-set evaluation uses 16 Mix-Headset meeting
46+
recordings (4--9 speakers per file), RTTM annotations from the
47+
standard AMI speaker-diarization benchmark, and the same DER settings
48+
(``collar=0.25``, ``skip_overlap=True``).
49+
50+
| Metric | Result |
51+
|--------|--------|
52+
| Files | 16 |
53+
| Weighted DER | 14.96% |
54+
| Mean DER | 14.63% |
55+
| Median DER | 14.18% |
56+
| Speaker count exact match | 4/16 (25%) |
57+
| Speaker count within +/-1 | 8/16 (50%) |
58+
59+
This confirms that meeting-domain audio is a harder case for automatic
60+
speaker counting. The estimator often collapses 6+ speaker meetings to
61+
4--5 speakers, even when aggregate DER remains moderate because some
62+
ground-truth speakers have little speaking time.
63+
4164
## CPU Speed (Real Time Factor)
4265

4366
RTF = processing_time / audio_duration. Lower is faster; RTF < 1.0 means
@@ -76,6 +99,34 @@ Measured on VoxConverse dev files on Apple M2 Pro / M2 Max
7699
warm-up. RTF = processing_time / audio_duration.
77100
- **Hardware:** Apple M2 Pro, macOS, CPU only (no GPU).
78101

102+
## Reproducing and Extending Benchmarks
103+
104+
The repository includes a dataset-agnostic RTTM runner for local
105+
experiments:
106+
107+
```bash
108+
python scripts/benchmark_rttm.py \
109+
--dataset voxconverse-dev \
110+
--audio-dir /path/to/voxconverse/dev/audio \
111+
--rttm-dir /path/to/voxconverse/rttm_annotations/dev \
112+
--output results_voxconverse_dev.json
113+
```
114+
115+
It also supports combined RTTM files and targeted diagnostics:
116+
117+
```bash
118+
python scripts/benchmark_rttm.py \
119+
--dataset ami-test \
120+
--audio-dir /path/to/ami/mix-headset/test \
121+
--rttm-file /path/to/AMI.SpeakerDiarization.Benchmark.test.rttm \
122+
--oracle-speakers \
123+
--file-id IS1009a
124+
```
125+
126+
Use ``--oracle-speakers`` to isolate speaker assignment and clustering
127+
quality when the true speaker count is known. Use ``--list-only`` to
128+
verify audio/RTTM matching without running inference.
129+
79130
## Limitations
80131

81132
!!! warning "Speaker count > 7"
@@ -108,14 +159,14 @@ Measured on VoxConverse dev files on Apple M2 Pro / M2 Max
108159

109160
## Future Work
110161

111-
!!! info "Single-dataset disclaimer"
112-
All results above are from VoxConverse dev set only. We are actively
113-
expanding evaluation to ensure the algorithm generalises well and is
114-
not overfit to a single benchmark.
162+
!!! info "Cross-dataset validation in progress"
163+
VoxConverse remains the primary published benchmark. AMI is now used
164+
as an additional meeting-domain check, and more datasets are needed
165+
before making broad accuracy claims.
115166

116167
**Planned evaluation:**
117168

118-
- **Cross-dataset validation** --- AMI, DIHARD III, CALLHOME, and other
169+
- **Cross-dataset validation** --- DIHARD III, CALLHOME, and other
119170
standard benchmarks, run in isolated environments with controlled
120171
CPU/memory limits.
121172
- **Speaker count estimation comparison** --- dedicated benchmarks comparing

docs/how-it-works.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ speakers while keeping computational cost low.
7676

7777
**Step 3 --- Silhouette refinement.** BIC is used as an anchor, then a
7878
small neighbourhood around it is scored with silhouette over cosine
79-
distance. The candidate range is clamped by `min_speakers`,
80-
`max_speakers`, and the number of available embeddings. This catches
81-
some BIC undercounts and overcounts without searching the full range.
79+
distance plus a small logarithmic bonus for larger *k*. The candidate
80+
range is clamped by `min_speakers`, `max_speakers`, and the number of
81+
available embeddings. This catches some BIC undercounts and overcounts
82+
without searching the full range.
8283

8384
!!! warning
8485
For **8 or more speakers** the estimator can undercount.

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ for seg in result.segments:
2929
| GPU required | No | No (7x slower on CPU) | No |
3030
| HuggingFace account | No | Yes | Yes |
3131
| Auto speaker count | Yes | Yes | Yes |
32-
| DER (VoxConverse dev) | **~5.0%** | ~11.2% | ~8.5% |
32+
| DER (VoxConverse dev) | **~4.8%** | ~11.2% | ~8.5% |
3333
| CPU speed (RTF) | **0.12** | 0.86 | --- |
3434

3535
DER and speed numbers for pyannote are from their
@@ -40,7 +40,7 @@ The diarize number is from the VoxConverse dev evaluation described in
4040
## Next Steps
4141

4242
- [How It Works](how-it-works.md) --- pipeline architecture and algorithms
43-
- [Benchmarks](benchmarks.md) --- VoxConverse evaluation, speed comparison, limitations
43+
- [Benchmarks](benchmarks.md) --- VoxConverse, AMI, speed comparison, limitations
4444
- [API Reference](api.md) --- full auto-generated API documentation
4545

4646
## License

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "diarize"
7-
version = "0.1.1"
7+
version = "0.1.2"
88
description = "Speaker diarization for Python — detect who spoke when in audio files. CPU-only, no GPU, no API keys, no account signup. Automatic speaker count detection."
99
readme = "README.md"
1010
license = "Apache-2.0"

0 commit comments

Comments
 (0)