CQFIO / PhotographicImageSynthesis

Photographic Image Synthesis with Cascaded Refinement Networks
https://cqf.io/ImageSynthesis/
1.25k stars 226 forks source link

two questions about the code #11

Open icoz69 opened 6 years ago

icoz69 commented 6 years ago

thanks for the code. its a cool implementation. i have two questions about the code 1. the first is about the 'computer_error' functions. for exmale,the size of fake and real are NHWC, after expand_dims(tf.reduce_mean(tf.abs(fake-real),reduction_indices=[3]),-1) ,the size is NHW1 then the result label returns NHW20,and the final result of this function is N*20,right?

2.the second question is label:np.concatenate((label_images[ind],np.expand_dims(1-np.sum(label_images[ind],axis=3),axis=3)),axis=3) why the 19-dimention label maps are concatenated with np.expand_dims(1-np.sum(label_images[ind],axis=3),axis=3)). i guess the later parts refers to some transformation error between RGB label images and 19-dimention labels.

thanks

CQFIO commented 6 years ago
  1. That's correct.

  2. I expand a 19D label map to 20D. The expanded extra dimension is for "void" regions. This ensures that each pixel has a one-hot-vector at each pixel. This prevents the network performing convolutions with a tensor with all zeros.