I used local open-weight models to translate and shorten dialogue, then measured where their output failed. The useful result was not a perfect dub: it was a set of checks that make failures visible.
What I Built
Localisation measurements is a Python toolkit with four command-line checks:
- Estimated dialogue fit inside a time window.
- Subtitle timing, overlap and reading speed.
- Latency and accumulated drift budgets.
- Terminology consistency and figures.
The core tools use only the Python standard library. A separate example uses Opus-MT for English-to-French translation and Gemma 3 4B through local Ollama for shorter variants. Complete video dubbing and live interpretation applications are future integration work; this repository does not ship dub or interpret commands.
Demo
The examples below describe saved model outputs. Their timing ratios can be recalculated from the repository; they are not a new run of model inference.
Twelve invented dialogue lines were translated with Opus-MT in the recorded experiment. The heuristic counted 102 English syllables and 98 French syllables. That small sample does not establish a general expansion rate between languages.
The per-line checks were more useful: four translations fit directly, two needed stretching, two were too short and four were too long under the configured timing model.
Important qualification: these windows were calculated from English syllable counts, not taken from recorded audio. Spoken durations are also estimates. A fit ratio is a useful review signal, not proof of audio synchronisation.
Gemma proposed shorter variants for the four overlong lines. Three saved candidates fall inside the configured window of 0.80 to 1.06. One example:
Line 011
Before: Et les autres, on ne peut pas les abandonner.
After: Et les autres, on ne les abandonne pas.
Estimated fit after adaptation: 0.968x
Line 001 stays below the lower bound at 0.793x. It is rejected rather than called a success. These are different dialogue lines: the 2.38x failure on line 001 does not become the 0.97x result on line 011.
Timing alone cannot validate meaning. Line 008 changes from past to present tense while passing its timing check. All candidates require human review.
Code
Source and reproduction instructions
python -B verifier.py
python localisation/ajuster_doublage.py exemples/segments-opusmt.json
The verifier passes 78 cases checking exit codes and hand-calculated results. The example input can deliberately produce a failing quality-check exit code: that means a measurement found a problem.
Fresh adaptation requires Ollama with gemma3:4b installed:
python exemples/adapter_avec_gemma.py
Fresh generations may differ from the saved experiment. The repository documents model dependencies separately from the standard-library checks.
Why Local Open Models Matter
Local inference lets users inspect intermediate text, measure it, and reject it before synthesis. The four measurements can also run independently of any model. Model weights and their individual licences are separate from the code, which is distributed under AGPL-3.0-or-later.
Limits And Provenance
The toolkit and saved experiments were created on 25 October 2026. This is prior work relative to the announced 26 October opening of Week 4. Eligibility and any required challenge tags must be checked against the final published rules before submitting.
This project does not demonstrate measured speech latency, finished audio, voice cloning controls, stem separation, or end-to-end dubbing. No agent-session sharing link is claimed. Prize categories and awards are not assumed.
Top comments (0)