Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on visualizing the avg. spectrum of CNN-generated images (Fig.7 of paper) #21

Open
cocoaaa15 opened this issue Oct 29, 2022 · 1 comment

Comments

@cocoaaa15
Copy link

cocoaaa15 commented Oct 29, 2022

Hi, thank you for sharing the repo.
I'm trying to replicate the spectra reported in Figure 7 by following the steps in Sec 4.6 (below), but am not seeing as vibrant patterns as in the Figure.

image
image

Could you share the code that you used to generate these spectra and share specific parameters you used?
- What is the fiter size of your median filter?
- What synthetic images (e.g. images in each model folder of the released CNN_synthe_testset) did you use?
- For conditional GANs (e.g., ProGAN, StyleGAN), did you take the average over all categories whose synthetic images are available? The reason for asking this question is that I got noticeably different patterns per category when I visualized the spectra of images per category (of, say, ProGAN). So I'm wondering whether the reported spectra of conditional GMs are computed per category (and if so, which category) or averaged over all categories available.
- How many images did you use to compute the average spectra?

Thanks again for your time!

@PeterWang512
Copy link
Owner

PeterWang512 commented Apr 5, 2024

Thanks so much for your interest in our work! I couldn't find my code for now, but here's a pseudocode for this:

# Iterate over 2000
images specs = []
for img in imgs_2000:
  img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  median = cv2.medianBlur(img,5)
  HF = img - median
  specs.append(fft2(HF))
  specs = np.mean(np.array(specs), axis=0)
  plt.imshow(np.log(fftshift(specs).abs() + 1e-6))
  plt.show() 
  • I randomly select a subset of 2000 synthetic images
  • yes, I believe for conditional GANs I randomly select images such that each category has same number of images

I hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants