SusungHong / Self-Attention-Guidance

The implementation of the paper "Improving Sample Quality of Diffusion Models Using Self-Attention Guidance" (ICCV`23)
MIT License
107 stars 14 forks source link

How to obtain high-frequency masks #6

Open yangqy1110 opened 11 months ago

yangqy1110 commented 11 months ago

Excellent work, I have been following it since a long time ago. Can you provide the code for obtaining the high-frequency masks in Figure 4? This is very important to me, thank you.

TyroneLi commented 11 months ago

Me too. I do want to know how to extract and visualize these masks shown in paper.

gseonglee commented 11 months ago

Hi! Thank you for your interest in our project. Unfortunately, we have deleted all code except for what was uploaded on GitHub and HF, so the specific codes we used are no longer available. However, the method isn't complicated, and here are the details:

We passed the given image through a Gaussian high-pass filter to extract the high-frequency components. Following that, we applied thresholding to generate a binary mask. Finally, we overlaid this mask in red onto the original image to create the high-frequency mask as shown in Fig. 4.