eurecom-asp / rawnet2-antispoofing

This repository includes the code to reproduce our paper "End-to-end anti-spoofing with RawNet2" (https://arxiv.org/abs/2011.01108) published in ICASSP '21.
MIT License
48 stars 13 forks source link

something problem in data_utils_LA.py #3

Closed mimao123 closed 2 years ago

mimao123 commented 2 years ago
def _parse_line(self, line):
    tokens = line.strip().split(' ')
    if self.is_eval:
        return ASVFile(speaker_id=tokens[0],
            file_name=tokens[1],
            path=os.path.join(self.files_dir, tokens[1] + '.flac'),
            sys_id=self.sysid_dict[tokens[2]],
            key=int(tokens[3] == 'bonafide'))
    return ASVFile(speaker_id=tokens[0],
        file_name=tokens[1],
        path=os.path.join(self.files_dir, tokens[1] + '.flac'),
        sys_id=self.sysid_dict[tokens[2]],
        key=int(tokens[3] == 'bonafide')

maybe sys_id=self.sysid_dict[tokens[3]]? and key=int(tokens[4] == 'bonafide'))? because tokens[2] == '-'

TakHemlata commented 2 years ago

Hello,

Yes, I think you downloaded protocol from asvspoof website.

As you can check in database folder in git repo for that this code will work fine.

Yes for protocol downloaded from ASVspoof 2019 website you need to use following:

def _parse_line(self, line): tokens = line.strip().split(' ') if self.is_eval: return ASVFile(speaker_id=tokens[0], file_name=tokens[1], path=os.path.join(self.files_dir, tokens[1] + '.flac'), sys_id=self.sysid_dict[tokens[3]], key=int(tokens[4] == 'bonafide')) return ASVFile(speaker_id=tokens[0], file_name=tokens[1], path=os.path.join(self.files_dir, tokens[1] + '.flac'), sys_id=self.sysid_dict[tokens[3]], key=int(tokens[4] == 'bonafide')

I will change the database folder and in the code also.

Thanks