tranluan / Nonlinear_Face_3DMM

Source code for "Nonlinear 3D Face Morphable Model"
http://cvlab.cse.msu.edu/project-nonlinear-3dmm.html
Apache License 2.0
676 stars 124 forks source link

About reconstruction loss #29

Open Agent-INF opened 5 years ago

Agent-INF commented 5 years ago

Hey! I have an issue about the reconstruction loss in https://github.com/tranluan/Nonlinear_Face_3DMM/blob/1c0c7d388231e26460303134ad9b0f87357d010c/model_non_linear_3DMM.py#L198 where the G_images_300W_mask.shape would be (batch_size 224 224 *3) after it multiplied with input_masks_300W in https://github.com/tranluan/Nonlinear_Face_3DMM/blob/1c0c7d388231e26460303134ad9b0f87357d010c/model_non_linear_3DMM.py#L164 since input_masks_300W is loaded by filename2image() with channels=3: https://github.com/tranluan/Nonlinear_Face_3DMM/blob/1c0c7d388231e26460303134ad9b0f87357d010c/model_non_linear_3DMM.py#L97 Therefore, I believe using tf.reduce_sum(G_images_300W_mask) to compute G_loss_recon will leading to a three times smaller loss. Is there anything I was missing?