Skip to content

Commit ab9fdac

Browse files
committed
Merge dev_v1.8.12: WhisperSeg VAD + tight defaults retune
2 parents 97ad9a4 + 847e538 commit ab9fdac

45 files changed

Lines changed: 4781 additions & 273 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NOTICES

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
WhisperJAV — Third-Party Notices
2+
================================
3+
4+
This file lists third-party code and model weights vendored, adapted, or
5+
downloaded at runtime by WhisperJAV. WhisperJAV itself is distributed under
6+
the terms of its top-level LICENSE file.
7+
8+
--------------------------------------------------------------------------------
9+
Component: whisperjav/modules/speech_segmentation/backends/whisperseg.py
10+
Source: https://huggingface.co/TransWithAI/Whisper-Vad-EncDec-ASMR-onnx
11+
inference.py (MIT License)
12+
Used for: State-machine post-processing of frame-level speech probabilities
13+
(hysteresis, duration filtering, padding with overlap prevention)
14+
ported to WhisperJAV's SpeechSegmenter Protocol.
15+
Model: model.onnx (119 MB) downloaded on first run via HuggingFace Hub
16+
from the same repository.
17+
License: MIT
18+
19+
MIT License
20+
21+
Copyright (c) TransWithAI contributors
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy
24+
of this software and associated documentation files (the "Software"), to deal
25+
in the Software without restriction, including without limitation the rights
26+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27+
copies of the Software, and to permit persons to whom the Software is
28+
furnished to do so, subject to the following conditions:
29+
30+
The above copyright notice and this permission notice shall be included in all
31+
copies or substantial portions of the Software.
32+
33+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
SOFTWARE.
40+
41+
Reference:
42+
Gu et al., "WhisperSeg: Positive Transfer of the Whisper Speech Transformer
43+
to Human and Animal Voice Activity Detection" (2023).
44+
https://github.com/nianlonggu/WhisperSeg

docs/ISSUE_TRACKER_v1.8.x.md

Lines changed: 150 additions & 71 deletions
Large diffs are not rendered by default.

docs/release_notes_v1.8.12.md

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
# WhisperJAV v1.8.12 — WhisperSeg VAD + tight defaults retune
2+
3+
**New speech segmenter (WhisperSeg) + tightened VAD defaults + sensitivity retune**
4+
5+
The headline feature is **WhisperSeg**, a new ONNX-based speech segmenter
6+
trained on ~500 hours of Japanese ASMR. It outperforms Silero v3.1, Silero
7+
v6.2, and TEN-VAD on a Netflix-quality JAV reference clip (F1 = 0.787 vs
8+
0.625–0.698 for prior backends, aggressive sensitivity).
9+
10+
This release also tightens the default VAD `max_speech_duration_s` and
11+
`max_group_duration_s` across all four in-scope speech segmenters, retunes
12+
the Faster-Whisper / OpenAI Whisper aggressive sensitivity preset based on
13+
forensic acceptance testing, and ships a new offline VAD evaluator tool.
14+
Several bug fixes round out the release including a critical ASR regression
15+
fix that affected aggressive sensitivity on tight VAD groups.
16+
17+
---
18+
19+
## What's new
20+
21+
### WhisperSeg ONNX speech segmenter — new VAD backend (#headline)
22+
23+
A new speech segmenter, `whisperseg`, is now selectable from the GUI Ensemble
24+
tab and the CLI (`--qwen-segmenter whisperseg`, `--pass1/2-speech-segmenter
25+
whisperseg`). It's the strongest VAD backend currently shipped for soft /
26+
whispered Japanese speech.
27+
28+
- **Architecture**: Whisper-base encoder paired with a 2-layer transformer
29+
decoder, exported to ONNX. Frame-level resolution at 20 ms over 30-second
30+
input windows. Inherits Whisper's multilingual robustness for non-JA
31+
content.
32+
- **Training data**: ~500 hours of Japanese ASMR audio with accurate
33+
timestamps. Strong on whispered/soft speech common in JAV.
34+
- **Performance** on `test_media/283sec-The.Naked.Director.S01E04.Scene4.mkv`
35+
(Netflix-GT 283 s clip, aggressive sensitivity):
36+
37+
| VAD backend | F1 |
38+
|--------------|------:|
39+
| **whisperseg** | **0.787** |
40+
| ten | 0.698 |
41+
| silero-v6.2 | 0.654 |
42+
| silero-v3.1 | 0.625 |
43+
44+
- **Install**: `pip install whisperjav[whisperseg]` (CPU) or
45+
`whisperjav[whisperseg-gpu]` (CUDA via onnxruntime-gpu). The Windows
46+
standalone installer ships with onnxruntime already; just select
47+
WhisperSeg in the GUI.
48+
- **Model**: `TransWithAI/Whisper-Vad-EncDec-ASMR-onnx`, MIT-licensed,
49+
pinned to revision `6ac29e2c`. ~119 MB ONNX file, downloaded once on
50+
first use.
51+
52+
### Tight VAD defaults (max_speech / max_group)
53+
54+
VAD speech-segment and group durations are tightened across all four
55+
in-scope segmenters (Silero v3.1/v4.0, Silero v6.2, TEN, WhisperSeg) to
56+
match the natural distribution of Japanese subtitles (research shows the
57+
majority of JA subs are <3 s with ~800 ms inter-sub gaps). Sensitivity
58+
gradient is **inverted** from prior versions: aggressive now uses tighter
59+
caps (more sensitive detection benefits from tighter grouping), conservative
60+
uses looser caps.
61+
62+
| Sensitivity | max_speech_duration_s | max_group_duration_s |
63+
|---------------|----------------------:|---------------------:|
64+
| Aggressive | 4 (was 7–8) | 5 (was 9–10) |
65+
| Balanced | 5 (was 6–7) | 6 (was 8–9) |
66+
| Conservative | 6 (was 5–6) | 7 (was 7–8) |
67+
68+
YAML files updated: `silero-speech-segmentation.yaml`,
69+
`silero-v6-speech-segmentation.yaml`, `ten-speech-segmentation.yaml`,
70+
`whisperseg-speech-segmentation.yaml`. The legacy `SileroVAD` Pydantic
71+
preset is mirrored in lockstep.
72+
73+
### Engine-split sensitivity preset retune (Faster-Whisper / OpenAI Whisper)
74+
75+
Faster-Whisper and OpenAI-Whisper presets diverge per-engine where forensic
76+
evidence warrants. Aggressive `no_speech_threshold` is raised from 0.77 to
77+
0.84 (more permissive, captures more intimate speech). Aggressive
78+
`logprob_threshold` is now `-1.30` for OpenAI Whisper only — Faster-Whisper
79+
keeps `-1.00`. Several other compute knobs are tuned.
80+
81+
### VAD ground-truth analyser (new tool)
82+
83+
`tools/vad_groundtruth_analyser/` — side-by-side VAD evaluator. Runs N VAD
84+
backends on the same media file and produces interactive Plotly HTML +
85+
JSON + CSV showing per-backend speech regions and aggregate stats.
86+
Optional ground-truth SRT enables F1 / IoU / drift / miss-rate / FA-rate
87+
metrics; without GT, an inter-backend agreement matrix is shown instead.
88+
89+
```bash
90+
python -m tools.vad_groundtruth_analyser MEDIA [--ground-truth SRT] \
91+
[--sensitivity {cons,bal,agg}] \
92+
[--backends silero-v3.1,silero-v6.2,ten,whisperseg]
93+
```
94+
95+
---
96+
97+
## Critical bug fixes
98+
99+
### Aggressive sensitivity empty-output regression (post-release fix in same train)
100+
101+
A regression introduced earlier in v1.8.12 development (commit `34fa713`,
102+
"engine-split sensitivity preset retune") changed Faster-Whisper aggressive
103+
`best_of: 2 → 1`. On JAV-style content with the new tight VAD groups
104+
(max_group=5 s), this caused Faster-Whisper's temperature 0.17 fallback to
105+
draw a single noisy hypothesis, often degenerate, which then failed the
106+
outer `no_speech` check and was dropped — producing 76.9% empty VAD groups
107+
on the F5 acceptance test.
108+
109+
**Fix**: revert aggressive `best_of: 1 → 2`. Beam search at temperature 0
110+
uses `beam_size`, which is unrelated to `best_of`; only the temperature
111+
fallback (sampling mode) uses `best_of` as `num_hypotheses`. Empirical
112+
F6 acceptance test confirmed: Pass 1 recall jumped from **19.1% → 88.2%**,
113+
F1 from **0.316 → 0.929**, with output produced in 80 s vs 337 s pre-fix.
114+
115+
### Silero version fallback alignment (v4.0 → v3.1)
116+
117+
`faster_whisper_pro_asr.py` and `whisper_pro_asr.py` previously fell back to
118+
`silero-v4.0` when the resolver did not explicitly set
119+
`params.speech_segmenter.backend`. This silently overrode the
120+
`LEGACY_PIPELINES["balanced"|"fidelity"]["vad"] = "silero-v3.1"` declaration
121+
that ships in this release line. Changed to `silero-v3.1` so runtime
122+
matches the declared LEGACY_PIPELINES default.
123+
124+
### Anime-whisper ellipsis-only line filter
125+
126+
The anime-whisper generator backend (Qwen pipeline with
127+
`--qwen-generator anime-whisper`) sometimes produces SRT entries containing
128+
only `` (or `…?`, `…!`, `…」`, etc.) for short non-speech regions
129+
(breathing, ambient, music). These are now detected and removed at two
130+
layers:
131+
132+
- **Text level** (`AnimeWhisperCleaner.clean()`): returns `""` for any
133+
string whose stripped form consists only of ellipsis-like chars +
134+
optional closing punct/quotes + whitespace AND contains at least one
135+
ellipsis/dot character.
136+
- **SRT level** (`AnimeWhisperCleaner.filter_srt_file()`): defense-in-depth
137+
pass after stitching that drops empty/ellipsis-only entries and
138+
renumbers surviving entries 1..N.
139+
140+
Wired into `qwen_pipeline.py` Phase 8 only when
141+
`generator_backend == "anime-whisper"`. Qwen3-ASR's Phase 8 remains
142+
skipped (no behavioral change for that path).
143+
144+
### TEN VAD `max_speech_duration_s` no longer silently stripped
145+
146+
`ten-speech-segmentation.yaml` defines `max_speech_duration_s`, but the
147+
factory `_PARAM_SCHEMAS["ten"]` did not include the key. The factory's
148+
foreign-key defense-in-depth gate (which strips params not in the
149+
backend's schema) was silently dropping this value before it reached the
150+
TEN backend. The schema now includes it. Factory fallback defaults for
151+
`ten`, `silero-v6.2`, and `whisperseg` are also aligned to the new YAML
152+
balanced presets so a cleared GUI input field produces a sensible default
153+
rather than a stale value.
154+
155+
### Anime-mode `chunk_threshold_s` plumbing
156+
157+
`QwenPipeline` Phase 4 now forwards `self.segmenter_chunk_threshold` into
158+
`SpeechSegmenterFactory.create()`. Previously only `max_group_duration_s`
159+
was injected; the chunk_threshold from the orchestrator's segmenter_config
160+
silently won. Anime mode's intended `chunk_threshold_s = 0.5` (set in
161+
`qwen_pipeline.py` for the anime-whisper override) now actually reaches
162+
the factory.
163+
164+
### CLI: `whisperseg` added to `--qwen-segmenter` choices
165+
166+
Argparse choices for `--qwen-segmenter` were missing `whisperseg`, so
167+
selecting it via the Qwen-pipeline CLI was rejected with an
168+
`invalid choice` error. Now accepted. (The `--pass1/2-speech-segmenter`
169+
flag is free-form string and was already working.)
170+
171+
---
172+
173+
## Refactors and cleanup
174+
175+
- **`neg_threshold` removed from speech-segmenter VADs** — the negative
176+
threshold (used for hysteresis in some Silero versions) is now
177+
auto-derived internally as `max(threshold − 0.15, 0.01)` and is no
178+
longer a user-facing parameter on speech segmenters. The factory
179+
`_sanitize_params` silently strips it from old configs for back-compat.
180+
Scene-detection-layer `silero_neg_threshold` is a separate namespace
181+
and is unchanged.
182+
- **GUI Ensemble dropdown simplified**`nemo`, `whisper-vad-*` and other
183+
rarely-used speech segmenters are hidden from the GUI Ensemble dropdown
184+
(CLI access preserved). Removes clutter for the typical user.
185+
186+
---
187+
188+
## How to upgrade or install
189+
190+
**Upgrade from 1.8.11:**
191+
192+
```
193+
pip install -U --no-deps "whisperjav @ git+https://github.com/meizhong986/whisperjav.git@v1.8.12"
194+
```
195+
196+
**Fresh install:**
197+
198+
### Windows — Standalone Installer (.exe)
199+
200+
1. Download **WhisperJAV-1.8.12-Windows-x86_64.exe** from the Assets below
201+
2. Run the installer (no admin rights required)
202+
3. Wait 5–10 minutes for setup to complete
203+
4. Launch from the Desktop shortcut
204+
205+
Installs to `%LOCALAPPDATA%\WhisperJAV`. A desktop shortcut is created
206+
automatically. Your GPU is detected automatically.
207+
208+
### macOS
209+
210+
Requires [Git](https://git-scm.com/downloads). The install script checks
211+
for Xcode CLI Tools, Python, FFmpeg, PortAudio. Open Terminal and run:
212+
213+
```bash
214+
cd ~
215+
git clone https://github.com/meizhong986/whisperjav.git
216+
cd whisperjav
217+
git checkout v1.8.12
218+
installer/install_mac.sh
219+
```
220+
221+
After installation, open the `whisperjav` folder in Finder and double-click
222+
**WhisperJAV.command** to launch the GUI.
223+
224+
### Linux
225+
226+
Requires Git and Python 3.10–3.12. Open a terminal and run:
227+
228+
```bash
229+
cd ~
230+
git clone https://github.com/meizhong986/whisperjav.git
231+
cd whisperjav
232+
git checkout v1.8.12
233+
installer/install_linux.sh
234+
```
235+
236+
After installation, launch the GUI with `./WhisperJAV.sh`.
237+
238+
### Windows — Source Install
239+
240+
Requires [Git](https://git-scm.com/downloads) and [Python 3.10–3.12](https://www.python.org/downloads/). Open a terminal and run:
241+
242+
```
243+
cd %USERPROFILE%
244+
git clone https://github.com/meizhong986/whisperjav.git
245+
cd whisperjav
246+
git checkout v1.8.12
247+
installer\install_windows.bat
248+
```
249+
250+
After installation, double-click **WhisperJAV.bat** to launch the GUI.
251+
252+
---
253+
254+
## Compatibility
255+
256+
Same as v1.8.11 — no dependency changes for the core. WhisperSeg adds
257+
optional extras (`whisperseg`, `whisperseg-gpu`) which are pulled in only
258+
when you select the WhisperSeg backend.
259+
260+
| Component | Supported Versions |
261+
|-----------|-------------------|
262+
| Python | 3.10, 3.11, 3.12 |
263+
| PyTorch | 2.4.0 – 2.10.x |
264+
| CUDA | 11.8+ (12.4+ recommended) |
265+
| onnxruntime | 1.16+ (CPU) / `onnxruntime-gpu` for CUDA WhisperSeg |
266+
| Ollama | 0.3.0+ recommended |
267+
268+
---
269+
270+
## Known issues
271+
272+
- **Windows standalone installer does not add its bundled tools to user
273+
PATH.** This is the same known issue as v1.8.11 — bundled ffmpeg 7.1
274+
may be shadowed by a system ffmpeg if the latter is on PATH. Workaround:
275+
launch via the Desktop shortcut (which activates the environment) or
276+
manually add `<install-dir>\Library\bin` to your user PATH. A proper fix
277+
remains planned for a future release.
278+
279+
- **ctranslate2 internal state contamination across `transcribe()` calls.**
280+
Forensic testing during this release uncovered that faster-whisper /
281+
ctranslate2 retains internal GPU/CPU state across multiple
282+
`transcribe()` calls on a single `WhisperModel` instance — and this
283+
state is *not* freed by `torch.cuda.empty_cache()` or `gc.collect()`.
284+
Production WhisperJAV uses a Model Reuse Pattern (single WhisperModel
285+
reused across all files in a batch) that may be silently degrading
286+
recall on later files in long batch runs. Mitigation candidate: periodic
287+
`WhisperModel` reload after N transcribes — planned for a future
288+
release.
289+
290+
- **Apple Silicon MPS + whisper-large-v3-turbo** — produces garbage output
291+
on MPS for this specific model. Use `--hf-device cpu` or the default
292+
kotoba model. (#198, #227)
293+
294+
- **Ollama download progress** — the download progress bar in the GUI
295+
popup is indeterminate (pulsing). Real progress is shown in the
296+
terminal.
297+
298+
---
299+
300+
## What's next
301+
302+
**v1.8.13 / v1.9.0 candidates** (no firm timeline):
303+
304+
- ctranslate2 state-contamination mitigation in the Model Reuse Pattern
305+
- Installer PATH fix for the bundled ffmpeg (carry-over from v1.8.11
306+
known issues)
307+
- ZipEnhancer Colab init bug (#290)
308+
- Qwen3-ASR `transformers` version pin (#280)
309+
- Full Ollama migration (remove llama-cpp-python)
310+
- Standalone subtitle merge CLI (#230)
311+
- Chinese GUI partial i18n (#175, #180)
312+
- Speaker diarization (#248, #252)
313+
314+
---
315+
316+
Thanks to everyone who reported issues, ran acceptance tests, and tested
317+
on their own material. The forensic acceptance tests on this release line
318+
(`test_media/1812acceptance/F2``F6`) drove most of the preset retune
319+
and the regression fix.

0 commit comments

Comments
 (0)