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

Is your denoiser directly taken from https://github.com/openai/guided-diffusion 256x256 diffusion (not class conditional): 256x256_diffusion_uncond.pt? #21

Closed xiximelon closed 8 months ago

xiximelon commented 9 months ago

image

yuanzhi-zhu commented 9 months ago

Yes ;)

xiximelon commented 9 months ago

thanks!

xiximelon commented 8 months ago

@yuanzhi-zhu 您好,不好意思再次打扰,想请问: 1.您训练FFHQ diffusion model的超参数分别是什么?这里参数是如何决定的呢?(以下是imagNet64的参数举例)

MODEL_FLAGS="--image_size 64 --num_channels 128 --num_res_blocks 3 --learn_sigma True" DIFFUSION_FLAGS="--diffusion_steps 4000 --noise_schedule cosine" TRAIN_FLAGS="--lr 1e-4 --batch_size 128"

2.训练的iteration如何确定,是靠之后image_sample.py的推理结果观察看哪一个.pth的结果更好吗?

yuanzhi-zhu commented 8 months ago

您好! Our work proposed a training-free method for image restoration, so we did not really train a model.

Anyway,

  1. you may want to check the paper of guided diffusion for the choice of these hyper-parameters
  2. you are right, for diffusion models training, it is common to sample the checkpoints for sanity checks and calculate the fid score to help find a good checkpoint.
xiximelon commented 8 months ago

Thanks ! I got it !

xiximelon commented 8 months ago

@yuanzhi-zhu Hello! I wonder how many iterations you use in inpainting task? Seems there's no specific number in the papar? And in inpaiting(random) tasks, what is the sampling ratio?

It is worth noting that since DPIR involves different iteration numbers for different tasks, we reported the minimum required number in the results. you wrote this in your paper, actually i didn't understand this, did it mean that DPIR and DiffPIR use the same iterations and use the minimum required iteration ?So how to decide the minimum iteration and the what number is the minimum iteration? Thanks!

yuanzhi-zhu commented 8 months ago

We choose the minimum iterations in DiffPIR empirically for different IR tasks. 20 is enough for SR and deburring, and 100 is usually required for inpainting to get a better result. And the iterations used in DiffPIR are independent of those in DPIR.

xiximelon commented 8 months ago

@yuanzhi-zhu Thanks again ! I wonder in inpaiting(random) tasks, the mask ratio is set to which number? is it 50%?

1698408015453
yuanzhi-zhu commented 8 months ago

@xiximelon That's correct!! In the paper, Section 4.1. Implementation Details reads:

For inpainting with box-type mask, the mask is 128×128 box region following the approach outlined in [8]; for inpainting with random-type mask, we mask out half of the total pixels at random; for inpainting with prepared mask images, we load the masks used in [38].

xiximelon commented 8 months ago

@yuanzhi-zhu Thank you for your detailed and quick response! That’s so nice of you !