taesungp / swapping-autoencoder-pytorch

Official Implementation of Swapping Autoencoder for Deep Image Manipulation (NeurIPS 2020)
Other
516 stars 84 forks source link

some detail about the code #32

Open Haosouth opened 2 years ago

Haosouth commented 2 years ago

Thank you very much for your work, I am trying to understand the code implementation, but I have encountered difficulties in some codes and cannot be solved. 1. I learned that the optimizer uses swapping_autoencoder_optimizer by default. This class uses a def prepare_images(data_i), but only returns data_i['real_A'], which does not seem to use 'real_B'. 2. In the subsequent self.E(real) process, sp and gl are output, and their mix=self.G(self.swap(sp),gl), why does the sp and gl used by mix come from the same sheet Image, shouldn't it be from real_A and real_B respectively, and what is the purpose of this self.swap(sp)? The above is my question. I am very sorry to bother you. If you are free, I hope you can answer my doubts. Thank you very much.

taesungp commented 2 years ago

Hello, I perform swapping by mixing the samples within real_A ([link here])(https://github.com/taesungp/swapping-autoencoder-pytorch/blob/main/models/swapping_autoencoder_model.py#L59).

real_B is actually not used in Swapping Autoencoder. It is used only when there are two distinct domains. But Swapping Autoencoder does not assume more than one domain, so you can ignore this, and assume that there is only real_A, which represents all images in the dataset.