clovaai / voxceleb_trainer

In defence of metric learning for speaker recognition
MIT License
1.03k stars 273 forks source link

Can anyone help me with "Saving score file as follows?" #142

Closed dimuthuanuraj closed 2 years ago

dimuthuanuraj commented 2 years ago

-0.6494 id10270/x6uYqmx31kE/00001.wav id10270/8jEAjG6SegY/00008.wav -1.3724 id10270/x6uYqmx31kE/00001.wav id10300/ize_eiCFEg0/00003.wav -0.7400 id10270/x6uYqmx31kE/00001.wav id10270/GWXujl-xAVM/00017.wav -1.2865 id10270/x6uYqmx31kE/00001.wav id10273/0OCW1HUxZyg/00001.wav -0.6512 id10270/x6uYqmx31kE/00001.wav id10270/8jEAjG6SegY/00022.wav -1.1112 id10270/x6uYqmx31kE/00001.wav id10284/Uzxv7Axh3Z8/00001.wav -0.6810 id10270/x6uYqmx31kE/00001.wav id10270/GWXujl-xAVM/00033.wav -1.0992 id10270/x6uYqmx31kE/00001.wav id10284/7yx9A0yzLYk/00029.wav -0.7889 id10270/x6uYqmx31kE/00002.wav id10270/5r0dWxy17C8/00026.wav -1.1319 id10270/x6uYqmx31kE/00002.wav id10285/m-uILToQ9ss/00009.wav

msh9184 commented 2 years ago

It can be done simply via the return values of the evaluateFromList function.

For example, you can try python trainSpeakerNet.py --eval --initial_model [your_model] after changing the 193th line of the trainSpeakerNet.py file as follows:

193    sc, lab, tr = trainer.evaluateFromList(**vars(args)) 
194    file = open('scores.txt', 'w')
195    for i, (s, t) in enumerate(zip(sc, tr)):
196        file.write('%f %s\n'%(s, t))
197    file.close()

https://github.com/clovaai/voxceleb_trainer/blob/9481143015109554840dcdd4a9bbefce897114a2/trainSpeakerNet.py#L193

dimuthuanuraj commented 2 years ago

Thank you @msh9184