wyhuai / DDNM

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

Generate different mask images according to the pixel values of different images #51

Open night333666 opened 10 months ago

night333666 commented 10 months ago

If I have a batch of data, which contains different types of data, I want to generate different mask images according to the pixel values of different images, and then restore the images with corresponding masks, how can I achieve this in your method.

wyhuai commented 10 months ago

Hi, I think generating the mask is independent of DDNM. When you have the mask, you can replace this line mask = torch.from_numpy(loaded).to(self.device). Make sure that 1 represents keep and 0 represents drop.

night333666 commented 10 months ago

Thank you for your answer. The dataset images I used were taken from movies, similar to pictures taken in everyday life. They are not part of the face and imagnet datasets. Do I need to retrain a model myself when I want to repair them using Inpainting?

wyhuai commented 10 months ago

Maybe you need a better pretraind diffusion model. We tried to apply DDNM to IF and it works well on general images.