MetricGAN icon indicating copy to clipboard operation
MetricGAN copied to clipboard

Running PESQ file

Open ana-kuznetsova opened this issue 4 years ago • 2 comments

Hi, Jason

I am trying to run MetricGAN.py But it fails while executing the read_pesq function.

def read_pesq(clean_root, enhanced_file, sr):
    f=enhanced_file.split('/')[-1]       
    wave_name=f.split('_')[-1].split('@')[0]
    clean_file=clean_root+'Train_'+wave_name+'.wav'
    
    cmd = PESQ_path+'/PESQ {} {} +{}'.format(clean_file, enhanced_file, sr)
    proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
    out = proc.communicate()
    pesq = float(out[0][-6:-1])
    return (pesq+0.5)/5.0

The particular error is (line 84):

    pesq = float(out[0][-6:-1])
ValueError: could not convert string to float:

I tried running it separately in bash in format

PESQ clean.wav enhanced.wav 16000

The error is PESQ: command not found

Could you, please, share more detail about how to use PESQ file?

Thank you very much!

ana-kuznetsova avatar Feb 24 '21 20:02 ana-kuznetsova

Hi Ana,

The error "ValueError: could not convert string to float:" comes from pesq function doesn't run properly.

you can test it on your command line by typing (under the directory of the PESQ file): ./PESQ clean.wav enhanced.wav +16000

Sincerely, Szu-Wei

JasonSWFu avatar Mar 02 '21 06:03 JasonSWFu

Hey Jason,

As you suggested, I tested PESQ on the command line.

For some sound files, everything works perfectly and I get an output like 'Prediction : PESQ_MOS = 1.391'. image

But in other cases, I get 'Processing error!'. image

Did you come across this problem? For reference, I am using the voicebank dataset. The testing file p232_001.wav works fine, but the testing file p232_002.wav did not. Thanks!

ImranKibria avatar Jul 26 '23 18:07 ImranKibria