yuanzhi-zhu / DiffPIR

"Denoising Diffusion Models for Plug-and-Play Image Restoration", Yuanzhi Zhu, Kai Zhang, Jingyun Liang, Jiezhang Cao, Bihan Wen, Radu Timofte, Luc Van Gool.
https://yuanzhi-zhu.github.io/DiffPIR/
MIT License
337 stars 25 forks source link

How to calculate FID? #6

Closed syf0518 closed 1 year ago

syf0518 commented 1 year ago

Thanks for your contribution, it is wonderful. Your article shows the average PSNR (dB), FID and LPIPS of different methods on Gaussian deblurring, motion deblurring and 4× SR, but I can't find the calculation of FID in your codes.I would appreciate it if you could tell me.

yuanzhi-zhu commented 1 year ago

Hi @syf0518 ,

In our case, the fid is calculated with https://github.com/mseitzer/pytorch-fid

python -m pytorch_fid path/to/dataset1 path/to/dataset2
syf0518 commented 1 year ago

Thank you for your reply.I just run the command "python -m pytorch_fid testsets/ffhq_val results/ffhq_val_deblur_DiffPIR_ffhq_10m_sigma0.05_NFE100_eta0.0_zeta0.1_lambda1.0_blurmodeGaussian", then it prints "FID: 230.38378567105474". It is too big,I want to know how to use pytorch_fid.I would appreciate it if you could tell me.

yuanzhi-zhu commented 1 year ago

Could you please check that only the restored images are in the folder results/ffhq_val_deblur_DiffPIR_ffhq_10m_sigma0.05_NFE100_eta0.0_zeta0.1_lambda1.0_blurmodeGaussian?

You may have to set save_L to False in this case https://github.com/yuanzhi-zhu/DiffPIR/blob/main/main_ddpir_deblur.py#LL43C63-L43C63

syf0518 commented 1 year ago

Thank you very much!I know how to use it now.