jymsuper / SpeakerRecognition_tutorial

Simple d-vector based Speaker Recognition (verification and identification) using Pytorch
MIT License
210 stars 46 forks source link

verifification.py #17

Closed Adarsh474532 closed 3 years ago

Adarsh474532 commented 3 years ago

sir speaker is different but verify is correct, how sir.

image

Adarsh474532 commented 3 years ago

result is wrong

jymsuper commented 3 years ago

The actual result is not wrong. It just shows wrong name. It says 'Claimed speaker : test'. Here, the 'test' is the name of the feature folder.

Are you using Window OS? Then, please change the code as follows (I assumed that the code is working on Ubuntu OS).

In the function 'perform_verification' of 'verification.py', Please change the code as below (use os.sep instead of '/'). test_spk = testfilename.split(os.sep)[-2].split('')[0]

Adarsh474532 commented 3 years ago

image image

This time is also wrong.

Adarsh474532 commented 3 years ago

image

but test with another embedding then result is right, how

jymsuper commented 3 years ago

Did you change what I wrote above? In your screen, claimed speaker is 'feat' True speaker or Claimed speaker should be the name of the speaker folder. Please carefully check the function 'perform_verification' and debug yourself. I guess this is just the print issue.

Adarsh474532 commented 3 years ago

def perform_verification(use_cuda, model, embeddings, enroll_speaker, test_filename, test_frames, thres): enroll_embedding = embeddings[enroll_speaker] test_embedding = get_embeddings(use_cuda, test_filename, model, test_frames)

score = F.cosine_similarity(test_embedding, enroll_embedding)
score = score.data.cpu().numpy() 

if score > thres:
    result = 'Accept'
else:
    result = 'Reject'

test_spk = test_filename.split(os.sep)[-2].split('_')[0]
print("\n=== Speaker verification ===")
print("True speaker: %s\nClaimed speaker : %s\n\nResult : %s\n" %(enroll_speaker, test_spk, result))
print("Score : %0.4f\nThreshold : %0.2f\n" %(score, thres))
Adarsh474532 commented 3 years ago

but , with old speaker work is correctly.

jymsuper commented 3 years ago

The folder structure should be the same. Check the folder structure. Also, check the variable 'test_spk' and 'test_filename'.

Adarsh474532 commented 3 years ago

image image my structure

Adarsh474532 commented 3 years ago

speaker verification.docx

Check the code please

jymsuper commented 3 years ago

I don't know why 'feat' is printed for 'Claimed speaker'. Check the variable 'test_spk' and 'test_filename'.

Adarsh474532 commented 3 years ago

speaker verification.docx

Check the code please

code is correct or wrong

jymsuper commented 3 years ago

I think the instruction is enough. Please debug yourself. This is just basic python debugging, not related to speaker verification algorithm. As I already mentioned, I guess this is just the print issue. Please check the variable 'test_spk' and 'test_filename'.

Adarsh474532 commented 3 years ago

image

error in sr_dataset.py

Adarsh474532 commented 3 years ago

I think the instruction is enough. Please debug yourself. This is just basic python debugging, not related to speaker verification algorithm. As I already mentioned, I guess this is just the print issue. Please check the variable 'test_spk' and 'test_filename'.

ok sir

jymsuper commented 3 years ago

You can ignore the main function in 'SR_dataset.py'. The main function is not used at all. Another functions in 'SR_dataset.py' are used in other files such as 'train.py'

Adarsh474532 commented 3 years ago

ok

Adarsh474532 commented 3 years ago

one last question sir image

np.set_printoptions(threshold=np.nan)

this line

jymsuper commented 3 years ago

You can remove the line

Adarsh474532 commented 3 years ago

ok

Adarsh474532 commented 3 years ago

Thank you sir for helping, project is not complete , my hope is down.

Thank you for helping

Adarsh474532 commented 3 years ago

sir, in the ubuntu same problem result is wrong Screenshot from 2021-07-28 14-31-49

Adarsh474532 commented 3 years ago

sir, it is possible any error in feature extraction then files is create error.

jymsuper commented 3 years ago

There should be no errors in feature extraction