yfeng95 / PRNet

Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network (ECCV 2018)
http://openaccess.thecvf.com/content_ECCV_2018/papers/Yao_Feng_Joint_3D_Face_ECCV_2018_paper.pdf
MIT License
4.94k stars 946 forks source link

The vertex index relationship between the 40K 3d face and the 3DMM face #4

Closed linVdcd closed 6 years ago

linVdcd commented 6 years ago

Thank you for release the code. It's a remarkable work. I want to train my own model with 300W_LP dataset. But I don't have the vertex index relationship between the 40K 3d face and the 3DMM face. Can you release it? Thank you.

yfeng95 commented 6 years ago

Hi, the vertices of 40K 3d face and 3DMM have no direct relations(although we can find the index with some re-sample error). In fact, the 40K 3d face is a re-sampling of 3DMM in the UV space.

Specifically, as described in section 3.1 in our paper, we used the UV coordinates of BFM from 3DMMasSTN (Thank the author again!) since 300W-LP is based on BFM.
Thus, if you want to train your own model:

  1. generate the vertices from 300W_LP dataset, then modify it a little bit(As describe in section 3.1, make sure the x,y coordinates of generated vertices are corresponding to the 2d face, the min value of z coordinates is 0)
  2. render the generated vertices with UV coordinates(re-sample). Here, the generated vertices is used as a texture(replace r,g,b with x,y,z) . I choose 256 as the size of UV space, thus we can get 256*256 = 65k vertices. The rendered image is the UV position map, which you will use to train your own model.

About the 40K 3d faces, I discarded the vertices of neck region since they are often occluded by hairs, then only 40K vertices are reserved. You can see the mask in https://github.com/YadiraF/PRNet/blob/master/Data/uv-data/uv_face_mask.png, black for discarded region.

linVdcd commented 6 years ago

@YadiraF I will try it! Thank you so much!!

developer-mayuan commented 6 years ago

@YadiraF I would like to know how to resample the 65k vertices in step 2? Which tool did you use to finish this task? Thanks.