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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: coreml
|
| 4 |
+
tags:
|
| 5 |
+
- speaker-verification
|
| 6 |
+
- speaker-embedding
|
| 7 |
+
- apple-silicon
|
| 8 |
+
- on-device
|
| 9 |
+
- coreml
|
| 10 |
+
- ios
|
| 11 |
+
- macos
|
| 12 |
+
- thestage-apple-sdk
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# ReDimNet2 Speaker Embedding (Apple Silicon)
|
| 16 |
+
|
| 17 |
+
[TheStage Apple SDK](https://github.com/TheStageAI/AppleSDK)
|
| 18 |
+
|
| 19 |
+
**Original model:** [ReDimNet2](https://github.com/PalabraAI/redimnet2) (Palabra AI) · [paper](https://arxiv.org/abs/2603.11841)
|
| 20 |
+
|
| 21 |
+
On-device **speaker embedding** for enrollment and cosine verification, packaged by **TheStage AI** for Apple Silicon. Produces a **192-d L2-normalized** vector from 16 kHz mono audio.
|
| 22 |
+
|
| 23 |
+
| | |
|
| 24 |
+
| --- | --- |
|
| 25 |
+
| Runtime | TheStage Apple SDK (`SpeakerEmbedding`) |
|
| 26 |
+
| Embedding dim | **192** (L2-normalized) |
|
| 27 |
+
| Window | **2.0 s** (32 000 samples @ 16 kHz) |
|
| 28 |
+
| Default device | **CPU** |
|
| 29 |
+
| HF engines | `TheStageAI/redimnet2` |
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
## Overview
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
Used by `TheStageVoiceAgent` for speaker ID (`config.speaker_id = "TheStageAI/redimnet2"`).
|
| 37 |
+
|
| 38 |
+
## System Requirements
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
| **Property** | **Value** |
|
| 43 |
+
| --- | --- |
|
| 44 |
+
| **Hardware** | Apple Silicon Mac, or physical iPhone / iPad |
|
| 45 |
+
| **macOS** | 15.0+ |
|
| 46 |
+
| **iOS** | 18.0+ |
|
| 47 |
+
| **Xcode** | 16.0+ |
|
| 48 |
+
| **Swift** | 6.0+ |
|
| 49 |
+
| **Flutter** (optional) | 3.24+ |
|
| 50 |
+
|
| 51 |
+
> Simulator is **not** supported — run on real Apple Silicon hardware.
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
## TheStage AI Access Token
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
Create a token at [app.thestage.ai](https://app.thestage.ai) and pass it to the SDK:
|
| 59 |
+
|
| 60 |
+
```swift
|
| 61 |
+
try await TheStageAI.shared.initialize(apiToken: "th_…")
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
```dart
|
| 65 |
+
await TheStageFlutterSDK.initialize(api_token: 'th_…');
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Token is checked online in `initialize` (once per app process when reachable). Inference runs fully on-device. Offline initialize fails — reconnect and call `initialize` again.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
## TheStage Apple SDK
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
Docs: [TheStage Apple SDK · Speaker embedding](https://docs.thestage.ai)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
### Installation (SwiftPM)
|
| 79 |
+
|
| 80 |
+
In Xcode: **File → Add Package Dependencies…**, paste `https://github.com/TheStageAI/AppleSDK.git`, and add the `TheStageSDK` product. Or in `Package.swift`:
|
| 81 |
+
|
| 82 |
+
```swift
|
| 83 |
+
.package(
|
| 84 |
+
url: "https://github.com/TheStageAI/AppleSDK.git",
|
| 85 |
+
exact: Version(1, 1, 0)
|
| 86 |
+
)
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Installation (Flutter / iOS)
|
| 90 |
+
|
| 91 |
+
```yaml
|
| 92 |
+
# pubspec.yaml
|
| 93 |
+
dependencies:
|
| 94 |
+
thestage_apple_sdk:
|
| 95 |
+
git:
|
| 96 |
+
url: https://github.com/TheStageAI/AppleSDK.git
|
| 97 |
+
path: plugin/thestage_apple_sdk
|
| 98 |
+
ref: 1.1.0
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
### Swift
|
| 103 |
+
|
| 104 |
+
```swift
|
| 105 |
+
import TheStageSDK
|
| 106 |
+
|
| 107 |
+
try await TheStageAI.shared.initialize(apiToken: "th_…")
|
| 108 |
+
|
| 109 |
+
let sid = try await SpeakerEmbedding(
|
| 110 |
+
engines_path: "TheStageAI/redimnet2"
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
// Enroll
|
| 114 |
+
let enroll = try sid.infer(audio: pcm_16k_mono)
|
| 115 |
+
// enroll.embedding: [Float] length 192
|
| 116 |
+
|
| 117 |
+
// Or via singleton JSON (same shape as Flutter):
|
| 118 |
+
try await TheStageAI.shared.start_model(
|
| 119 |
+
model_name: "speaker_id",
|
| 120 |
+
engines_path: "TheStageAI/redimnet2",
|
| 121 |
+
model_type: "thestage_speaker_embedding"
|
| 122 |
+
)
|
| 123 |
+
let out = try TheStageAI.shared.infer(
|
| 124 |
+
model_name: "speaker_id",
|
| 125 |
+
input_json: ["audio": pcm_16k_mono]
|
| 126 |
+
)
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
### Flutter (iOS)
|
| 130 |
+
|
| 131 |
+
```dart
|
| 132 |
+
await TheStageFlutterSDK.start_model(
|
| 133 |
+
model_name: 'speaker_id',
|
| 134 |
+
engines_path: 'TheStageAI/redimnet2',
|
| 135 |
+
);
|
| 136 |
+
|
| 137 |
+
final enrolled = await TheStageFlutterSDK.infer(
|
| 138 |
+
model_name: 'speaker_id',
|
| 139 |
+
input_json: {'audio': pcm16k},
|
| 140 |
+
);
|
| 141 |
+
final embedding = (enrolled[0]['embedding'] as List).cast<double>();
|
| 142 |
+
|
| 143 |
+
final check = await TheStageFlutterSDK.infer(
|
| 144 |
+
model_name: 'speaker_id',
|
| 145 |
+
input_json: {
|
| 146 |
+
'audio': pcm16k,
|
| 147 |
+
'embedding': embedding,
|
| 148 |
+
},
|
| 149 |
+
);
|
| 150 |
+
final similarity = check[0]['similarity'] as double;
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
### Audio contract
|
| 154 |
+
|
| 155 |
+
| | |
|
| 156 |
+
| --- | --- |
|
| 157 |
+
| Sample rate | **16 kHz** mono Float |
|
| 158 |
+
| Window | **2.0 s** — pad/trim trailing |
|
| 159 |
+
| Output | 192-d L2-normalized embedding; optional cosine `similarity` when a reference embedding is passed |
|
| 160 |
+
|
| 161 |
+
## Acknowledgments
|
| 162 |
+
|
| 163 |
+
---
|
| 164 |
+
|
| 165 |
+
This work builds on **ReDimNet2** by Palabra AI: [https://github.com/PalabraAI/redimnet2](https://github.com/PalabraAI/redimnet2).
|
| 166 |
+
|
| 167 |
+
Paper: [https://arxiv.org/abs/2603.11841](https://arxiv.org/abs/2603.11841).
|
| 168 |
+
|
| 169 |
+
Based on ReDimNet2 (Palabra AI). This Apple Silicon package is produced by TheStage AI; it is not an official Palabra AI release.
|
| 170 |
+
|
| 171 |
+
## Links
|
| 172 |
+
|
| 173 |
+
---
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
* __Original model (GitHub)__: [PalabraAI/redimnet2](https://github.com/PalabraAI/redimnet2)
|
| 177 |
+
* __Paper__: [https://arxiv.org/abs/2603.11841](https://arxiv.org/abs/2603.11841)
|
| 178 |
+
* __Platform__: [app.thestage.ai](https://app.thestage.ai)
|
| 179 |
+
* __TheStage Apple SDK__: [github.com/TheStageAI/AppleSDK](https://github.com/TheStageAI/AppleSDK)
|
| 180 |
+
* __Docs__: [docs.thestage.ai](https://docs.thestage.ai)
|
| 181 |
+
* __Subscribe for updates__: [TheStageAI X](https://x.com/TheStageAI)
|
| 182 |
+
* __Contact email__: contact@thestage.ai
|
| 183 |
+
|