Commit 8541d09
feat: optionally return per-speaker embedding centroids (#2967)
* feat(spk): optionally return per-speaker embedding centroids
Add a return_spk_center option so AutoModel.generate surfaces the per-speaker centroid embeddings (mean of clustered chunk embeddings) that diarization already computes in postprocess() but currently discards. Lets downstream speaker voiceprint / identity reuse them without re-embedding. Backward compatible: default off; postprocess return shape is unchanged unless return_spk_center=True.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(spk): address review on spk_embedding_center
- pass np.ndarray (not torch.Tensor) to postprocess to match its type hint
- update postprocess return hint to Union[list, tuple]
- compute spk_embs lazily, only when return_spk_center=True
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent cd38586 commit 8541d09
2 files changed
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
822 | 833 | | |
823 | 834 | | |
824 | 835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
| |||
184 | 181 | | |
185 | 182 | | |
186 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
0 commit comments