Fayeben / GenerativeDiffusionPrior

Generative Diffusion Prior for Unified Image Restoration and Enhancement (CVPR2023)
Apache License 2.0
276 stars 30 forks source link

Code based on the patch section #16

Closed Hikari6666 closed 3 weeks ago

Hikari6666 commented 1 year ago

Hello, I am very interested in your work. Can you tell me where the code for the proposed patch-based approach is?

Fayeben commented 1 year ago

Hi, we use the patch-based method for low-light enhancement and HDR recovery. Therefore, you can find the code in these two scripts. https://github.com/Fayeben/GenerativeDiffusionPrior/blob/116b875db9b4b6c3bcc8adcfc7dbaedb607e1edb/scripts/sample_x0_enhancement_low_light.py https://github.com/Fayeben/GenerativeDiffusionPrior/blob/116b875db9b4b6c3bcc8adcfc7dbaedb607e1edb/scripts/sample_x0_enhancement_HDR.py

ChenhLiwnl commented 1 year ago

Can you provide specific hints on which lines correspond to the operations of the patch section? I didn't quite understand this code, much gratitude!

Fayeben commented 1 year ago

Yes, you can check this line https://github.com/Fayeben/GenerativeDiffusionPrior/blob/b34494cd53e344a5c726e502f552cd7fb888aad0/scripts/guided_diffusion/gaussian_diffusion_x0_enhancement_direct.py#L455C1-L455C1