Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return frame_level speaker embedding #399

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions wespeaker/models/ecapa_tdnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,21 @@ def _get_frame_level_feat(self, x):
out = torch.cat([out2, out3, out4], dim=1)
out = self.conv(out)

return out
return out, out4

def get_frame_level_feat(self, x):
# for outer interface
out = self._get_frame_level_feat(x).permute(0, 2, 1)
out = self._get_frame_level_feat(x)[0].permute(0, 2, 1)
return out # (B, T, D)

def forward(self, x):
out = F.relu(self._get_frame_level_feat(x))
out, out4 = self._get_frame_level_feat(x)
out = F.relu(out)
out = self.bn(self.pool(out))
out = self.linear(out)
if self.emb_bn:
out = self.bn2(out)
return out
return out4, out


def ECAPA_TDNN_c1024(feat_dim, embed_dim, pooling_func='ASTP', emb_bn=False):
Expand Down
Loading