BFM_to_FLAME icon indicating copy to clipboard operation
BFM_to_FLAME copied to clipboard

How to convert Deep3DFace reusult mesh to flame?

Open skeras opened this issue 3 years ago • 6 comments

Hi, This project use standard BFM2009 convert to FLame, but deep3dface (https://github.com/sicxu/Deep3DFaceRecon_pytorch.git) generate mesh is not standart (71418,3), how to convert this mesh to flame? Thanks a lot!

skeras avatar Aug 11 '22 08:08 skeras

Can you provide one Deep3DFace mesh for reference?

TimoBolkart avatar Sep 06 '22 10:09 TimoBolkart

Thanks for your reply.
https://drive.google.com/file/d/15hwcxMMZCwyU37BeMjNRFL-48lLBU0fj/view?usp=sharing

skeras avatar Sep 06 '22 10:09 skeras

Sorry, I missed that. Deep3DFace uses BFM as underlying model. Do you have the vertex indices of those cropped faces?

TimoBolkart avatar Feb 08 '23 13:02 TimoBolkart

I have the same problem as well.

LinShiqi047 avatar Jun 26 '23 09:06 LinShiqi047

    # vertex indices for each face. starts from 0. [F,3]
    self.face_buf = model['tri'].astype(np.int64) - 1
    # vertex indices for 68 landmarks. starts from 0. [68,1]
    self.keypoints = np.squeeze(model['keypoints']).astype(np.int64) - 1

    if is_train:
        # vertex indices for small face region to compute photometric error. starts from 0.
        self.front_mask = np.squeeze(model['frontmask2_idx']).astype(np.int64) - 1
        # vertex indices for each face from small face region. starts from 0. [f,3]
        self.front_face_buf = model['tri_mask2'].astype(np.int64) - 1
        # vertex indices for pre-defined skin region to compute reflectance loss
        self.skin_mask = np.squeeze(model['skinmask'])

LinShiqi047 avatar Jun 26 '23 09:06 LinShiqi047