wyhuai / DDNM

[ICLR 2023 Oral] Zero-Shot Image Restoration Using Denoising Diffusion Null-Space Model
MIT License
1.08k stars 75 forks source link

How to reproduce the repainting results in a paper #43

Open YuzheZhang-1999 opened 1 year ago

YuzheZhang-1999 commented 1 year ago

Thanks for your great work!

I tried to reproduce the results in the bottom right of fig3 in the paper based on the “imagenet_256.yml” and “256*256_duffusion_uncond.pt” you provided, but my reconstructed image was poor.

May I ask if I didn't notice anything that caused this poor result?

wyhuai commented 1 year ago

The visualization results in fig3 are generated by "hq_demo", you can find instructions on the main page.

YuzheZhang-1999 commented 1 year ago

But I notice “hq_demo/evaluation.sh” only have the super-resolution inference, is there inpainting implement?

wyhuai commented 1 year ago

Yes, you can see the Colab for more demonstrations.

YuzheZhang-1999 commented 1 year ago

Thanks for your reply. But I only find face inpainting based on celebahq in the Colab, so how can I realize the Inpainting on DIV2K.

wyhuai commented 1 year ago

Just change the --deg, for example, python main.py --config confs/inet256.yml --path_y data/datasets/gts/inet256/323.png --class 323 --deg "inpainting" -i butterfly_sr.

Maybe you need to delete and conf.name=='face256' in gaussian_diffusion.py, line 601.

YuzheZhang-1999 commented 1 year ago

Okey I see, thank you so much for you patient answer

YuzheZhang-1999 commented 1 year ago

我按照你说的去做了,但是我发现这是有分类引导的,如果我尝试复现论文中Fig3右下角的水母的图片,在 classifier_scale=0时,会生成一些桔子的图片,这是怎么一回事。所以如何复现paper里fig3中一摸一样mask设置的结果

I did as you said, but I found that this is classifier guided. the command is "python main.py --config confs/inet256.yml --path_y data/datasets/gts/inet256/paper_fig3_jellyfish.jpg --deg "inpainting" -i imagnet"

And I try to reproduce the image of jellyfish picture in the lower right of Fig3 in your paper, with the classifier_scale=0, some images of oranges will be generated, I don't know why.

So how to reproduce the result of exactly the same mask setting in fig3 in paper.

wyhuai commented 1 year ago

You need to set the correct class label to guide the denoiser toward that class content. For example, jellyfish is 107.

wyhuai commented 1 year ago

https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a you can find the class here

YuzheZhang-1999 commented 1 year ago

thank you so much!