HarryVolek / PyTorch_Speaker_Verification

PyTorch implementation of "Generalized End-to-End Loss for Speaker Verification" by Wan, Li et al.
BSD 3-Clause "New" or "Revised" License
575 stars 166 forks source link

confusion about enrollment and inference handling? shape issue...? #23

Open MuruganR96 opened 5 years ago

MuruganR96 commented 5 years ago

https://github.com/HarryVolek/PyTorch_Speaker_Verification/issues/18#issuecomment-457776157

In train_speech_embedder.py, separated into enrollment and verification.

enrollment_batch, verification_batch = torch.split(mel_db_batch, int(mel_db_batch.size(1)/2), dim=1)

in the same i followed, separated into two functions, like enrollment, verification. in enrollment,

enrollment_batch, _ = torch.split(mel_db_batch, int(mel_db_batch.size(1)/2), dim=1)
torch.save("./dummy/speaker_embedding.pt", enrollment_centroids)

in verification,

_ , verification_batch = torch.split(mel_db_batch, int(mel_db_batch.size(1)/2), dim=1)
enrollment_centroids = torch.load("./dummy/speaker_embedding.pt")
sim_matrix = get_cossim(verification_embeddings, enrollment_centroids)

is this corrcect procedure or not?

then which way to handle enrollment and inference for speaker identification?

i am beginner in pytorch, any suggestions sir.

Thank you.