trevorlink commited on
Commit
74090f2
·
verified ·
1 Parent(s): 346ab75

Add B3 FP16 speaker model: README.md

Browse files
Files changed (1) hide show
  1. redimnet2-b3-onnx-fp16-v2/README.md +77 -0
redimnet2-b3-onnx-fp16-v2/README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ReDimNet2-B3 mixed ONNX FP16 for SpeechlessDo
2
+
3
+ Version directory: `redimnet2-b3-onnx-fp16-v2/` in the existing Hugging Face and
4
+ ModelScope `trevorlink/speechless-diarization` repositories. The earlier native
5
+ CoreML v1 package remains available as a historical artifact.
6
+
7
+ Derived from [PalabraAI/redimnet2](https://github.com/PalabraAI/redimnet2),
8
+ `model_name=b3`, `dataset=vb2+vox2+cnc2_v0`, `train_type=lm`.
9
+ The training mixture is VoxBlink2 + VoxCeleb2 + CN-Celeb2. No additional training.
10
+ The MIT license and upstream attribution accompany this package.
11
+
12
+ Checkpoint: `b3-vb2+vox2+cnc2_v0-lm.pt`, SHA-256
13
+ `b64989536ef8822447d72517ad9019b870a951e85a3f176f0ed42d2a4c3d811d`.
14
+ Original FP32 ONNX SHA-256:
15
+ `4f08dd7c8abf4430f1256b9e995d6bedc95cadfca7555a418bc650fa0cee1db8`.
16
+
17
+ ## Files and interface
18
+
19
+ Two files, **24,723,992 bytes total**:
20
+
21
+ | File | Purpose |
22
+ | -------------------------------- | ---------------------------------------------------------------------------------------------------------- |
23
+ | `redimnet2_b3_fp16_coreml.onnx` | FP16 compute graph, with FP32 waveform preprocessing and scalar compatibility repairs for CoreML MLProgram |
24
+ | `redimnet2_b3_fp16_weights.onnx` | FP16 neural weights restored to FP32 for CPU computation |
25
+
26
+ Both accept `waveform`, float32 `[1, num_samples]`, real mono PCM at 16 kHz;
27
+ both return a float32 `[1, 192]` embedding. Apply L2 normalization before cosine
28
+ comparison. This is a voice fingerprint, not an ASR transcript or a person's name.
29
+ `provenance.json` records exact file hashes, sizes and upstream identity.
30
+
31
+ ## App runtime
32
+
33
+ macOS 14+, shared ONNX Runtime **1.31.1**, Rust `ort` binding
34
+ `2.0.0-rc.11`. CoreML uses MLProgram, CPUAndGPU, and disables low-precision GPU
35
+ accumulation. The app lazily creates at most three sessions for exact lengths
36
+ 16,000 / 48,000 / 160,000 samples. Each cache includes model SHA-256, runtime
37
+ version and input length. Other lengths use the complete utterance on CPU.
38
+ CoreML initialization/inference failures fall back to complete-input CPU
39
+ inference and disable that shape's accelerated session for the current operation.
40
+
41
+ The app does not pad, crop, repeat, or average window embeddings. Pyannote
42
+ segmentation, complete-link clustering (cosine distance cutoff 0.9), speaker
43
+ consolidation and ASR planning remain shared. Other operating systems retain CAM++.
44
+
45
+ The same model graph with ORT 1.23.2 made 150 CoreML partition calls and 5,170 CPU
46
+ operator calls across five 3-second inferences. ORT 1.31.1 made 25 and 65 calls,
47
+ respectively. Partition counts do not measure GPU utilization or end-to-end speed.
48
+ A seven-length Rust regression compares the complete-input embedding with the
49
+ original FP32 model, including 48,001 samples to detect accidental 3-second cropping.
50
+
51
+ ## Evaluation and limitations
52
+
53
+ See the app's `docs/development/speaker-app-coreml-integration.md` for the v2
54
+ meeting regression, frozen verification protocol, per-meeting results and hardware
55
+ limitations. Earlier v1 native CoreML window-averaging results do not describe v2.
56
+ The evaluation uses English public speech and three AMI meetings; it does not prove
57
+ Chinese meeting accuracy, unknown-speaker rejection, or minutes-writing quality.
58
+ CoreML handles only the validated exact lengths; most arbitrary meeting utterances
59
+ therefore use the CPU path.
60
+
61
+ ## Reproduce and publish
62
+
63
+ The ONNX exports and scalar repair are implemented by
64
+ `scripts/eval-speaker-precision.py` and `scripts/eval-speaker-coreml.py` in the app
65
+ repository. `scripts/export-redimnet-coreml.py` reproduces the historical native v1
66
+ package, not this ONNX package.
67
+
68
+ ```sh
69
+ python scripts/publish-redimnet-speaker.py --model-dir /path/to/two-onnx-files
70
+ # Upload only the verified allowlist, with existing mirror credentials:
71
+ python scripts/publish-redimnet-speaker.py --model-dir /path/to/two-onnx-files --publish --env-file /path/to/local.env
72
+ ```
73
+
74
+ Publication preserves other repository files. It uploads the two verified models,
75
+ README, MIT license, NOTICE and provenance, then anonymously downloads every model
76
+ from both mirrors and verifies the complete SHA-256. Audio and private data are
77
+ excluded. The app continues using its existing lazy downloads and locale ordering.