XingangPan / GAN2Shape

Code for GAN2Shape (ICLR2021 oral)
https://arxiv.org/abs/2011.00844
MIT License
571 stars 104 forks source link

How do I do inference? #7

Open raagapranitha opened 3 years ago

raagapranitha commented 3 years ago

Hi, I am a beginner learner in GAN. I came across your paper and was impressed by your methodology. I did the training part of code on colab. I was wondering if there is any code shared to do inference on a test image? If not, can you please guide me how to do inference on a test image?

XingangPan commented 3 years ago

@raagapranitha Hi, thanks for your interest in our work. Note that our method is an online method, which means you need to do unsupervised training for each test image. For test images sampled from GAN, you may simply add the images and latent pathes to the training list, and run the training code. For real natural images, you need to encode the images to the latent space of the GAN, which you may refer to https://github.com/XingangPan/GAN2Shape/issues/6.

anyaviswa commented 3 years ago

Hi,

I have a follow-up question regarding model inference. Can you please clarify the below doubts?

1) How are you calculating the SIDE error, because I could see multiple images getting generated? Which one is being considered for evaluation? 2) My understanding is the images under test/depth folder being used as ground truth. Am I right?

Thank you for your time.

XingangPan commented 3 years ago

@anyaviswa

  1. The self.depth in forward_step1 is considered for evaluation (i.e., line 470 at model.py file).
  2. Yes, you are right.
anyaviswa commented 3 years ago

Thank you so much. My doubt is cleared.