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 123 forks source link

mask from zbuffer #23

Open wangxinjun56 opened 5 years ago

wangxinjun56 commented 5 years ago

tri_map_2d, mask_i = ZBuffer_Rendering_CUDA_op_v2_sz224(vertex2d_i, tri_const, visible_tri_i)

the mask_i is 224*224 , shape is (-1,);

masks.append(mask_i) masks = tf.stack(masks)

return images, masks

where the mask shape is wrong ,that

G_images_300W_mask = tf.multiply(input_masks_300W, tf.expand_dims(G_images_300W_mask, -1)) G_images_300W = tf.multiply(G_images_300W, G_images_300W_mask) + tf.multiply(input_images_300W, 1 - G_images_300W_mask)

tranluan commented 5 years ago

Can you elaborate on your question?

wangxinjun56 commented 5 years ago

the G_images_300W_mask .shape is wrong, should be batchsize 224 224 * 3 that can multiply with input_masks_300W

tranluan commented 5 years ago

The shape is batchsize 224 224 * 1, which is ok for the multiplication.

linshuheng6 commented 4 years ago

@tranluan Hello, could you please tell how to render the generated image with only face part? Or how to obtain the index of those vertices of face which doesn't include the neck and ear? The mask from Z-buffer includes neck, which is not expected. Thank you !