pix2pix-tensorflow
pix2pix-tensorflow copied to clipboard
PatchGAN?
I think the original pix2pix GAN is using patchGAN. Where is the code related to it in your Tensorflow version?
I have the same question.
haoliangjiang. May I ask you a question. I found something that is not quite clear. Let take example on facades data:
with the function:
def load_image(image_path):
input_img = imread(image_path)
w = int(input_img.shape[1])
w2 = int(w/2)
img_A = input_img[:, 0:w2]
img_B = input_img[:, w2:w]
return img_A, img_B
Then they are concatenated in order AB by:
img_AB = np.concatenate((img_A, img_B), axis=2)
so the model is about generating the realistic image from A to B (left to right in the image.). However, in "build_model(self)", A and B is flipped to each other by:
self.real_B = self.real_data[:, :, :, :self.input_c_dim]
self.real_A = self.real_data[:, :, :, self.input_c_dim:self.input_c_dim + self.output_c_dim]
My understanding is real_B is now the input imageA. So the calculation of "tf.reduce_mean(tf.abs(self.real_B - self.fake_B))" does not make any sense.
Bests,
In the case of PatchGAN, last layer of Discriminator have output channel always 1. nn.Conv2D(inchannel,outchannel,kernelsize,stride,padding): nn.Conv2D(128,1,3,1,1) ' '
I think the original pix2pix GAN is using patchGAN. Where is the code related to it in your Tensorflow version?
In his code, is not a picture outputting a value after D, but number of channel values,.which corresponds to patchGAN.
Did anyone find where is PatchGAN in this code? the last layer of the discriminator has feature maps 16x16x512 .... Is this size of feature maps refers to PatchGAN idea ? as mentioned in here https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/39#issuecomment-305575964