Skip to main content

Module embedder

Module embedder 

Source
Expand description

v1.0 Embedder trait + concrete extractors (CAM++, ResNet34) + pool + overlap-mask helper.

Added in v0.6 (M2).

Structs§

CamPlusPlusExtractor
CAM++ embedder (Channel-Attentive Multi-scale Pooling). Dim is supplied explicitly because WeSpeaker ships several CAM++ variants: voxceleb_CAM++.onnx is 512-d; smaller variants exist at 192-d. Targets the Mobile profile of v1.0; M5 may swap to INT8 + smaller dim. Uses the same 80-bin log-mel fbank pipeline as ResNet34.
EmbedderPool
Lock-free pool of Embedder instances for concurrent extraction.
ResNet34Adapter
New-trait adapter for the existing FbankOnnxExtractor (WeSpeaker ResNet34, 256-d).

Enums§

EmbedderError
Errors from Embedder implementations.

Traits§

Embedder
Speaker embedding extractor — turns a slice of 16 kHz mono audio into a fixed-dimension embedding vector. Implementations are expected to L2-normalize their output so cosine similarity is a meaningful metric downstream.

Functions§

apply_overlap_mask
{ true } pub fn apply_overlap_mask( audio: &[f32], overlap_regions: &[(f32, f32)], sample_rate: u32, ) -> Vec<f32> { ret.len() == audio.len() } Zero-fill audio samples in regions where the segmenter flagged a 2-speaker overlap. The returned Vec<f32> is a copy of audio with zeros in the (start_secs, end_secs) ranges listed in overlap_regions.