Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for evaluation in paper #32

Open
v-nhandt21 opened this issue May 13, 2022 · 6 comments
Open

Code for evaluation in paper #32

v-nhandt21 opened this issue May 13, 2022 · 6 comments

Comments

@v-nhandt21
Copy link

I found some automatic evaluation metrics mentioned in the paper, where can I find these scripts so that I can reproduce the result and compare with others method.

image

@sharvil
Copy link
Contributor

sharvil commented May 16, 2022

There's no implementation of these metrics in this repository. A code contribution here would be really helpful!

@zzw-zwzhang
Copy link

I found some automatic evaluation metrics mentioned in the paper, where can I find these scripts so that I can reproduce the result and compare with others method.

image

Have you solved this problem?

@zzw-zwzhang
Copy link

Could you provide the evaluation code? Thank you!

@v-nhandt21
Copy link
Author

v-nhandt21 commented Jul 1, 2022

For FID, I find an implement from torchmetric: https://torchmetrics.readthedocs.io/en/stable/image/frechet_inception_distance.html

But it required input much be in dtype=torch.unit8, while spectrogram I generate is in float, if I try to convert to int, get an error: ZeroDivisionError: float division by zero

def evaluation(mel_infer, mel_gt):
     mel_infer = torch.from_numpy(mel_infer).to("cuda").unsqueeze(0).unsqueeze(0).to(torch.uint8).repeat(1,3,1,1)
     mel_gt = torch.from_numpy(mel_gt).to("cuda").unsqueeze(0).unsqueeze(0).to(torch.uint8).repeat(1,3,1,1)

     mel_infer = torch.clamp(mel_infer, min=1e-5, max=1e-5)
     mel_gt = torch.clamp(mel_gt, min=1e-5, max=1e-5)

     fid = FrechetInceptionDistance(feature=2048).to("cuda")
     fid.update(mel_infer, real=False)
     fid.update(mel_gt, real=True)
     f = fid.compute()

     return f

@gzhu06
Copy link

gzhu06 commented Sep 1, 2022

@FlyingCan
Copy link

Hello,I want to ask a sound stupid question, How can I compute the FID value of the test dataset and train dataset? both of them are real data distribution. for example, If I want to compute the FID value of train dataset, I will input compute_fid_function(train_dataset,train_dataset)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants