anhttran / extreme_3d_faces

Extreme 3D Face Reconstruction: Looking Past Occlusions
Other
789 stars 184 forks source link

There was an error acquiring 3DDFA Expression Model #41

Closed wuxiaolianggit closed 3 years ago

wuxiaolianggit commented 4 years ago

There was an error acquiring 3DDFA Expression Model,Can you provide Expression Model to Google cloud disk,thanks very much.

wuxiaolianggit commented 4 years ago

There was an error acquiring 3DDFA Expression Model,Can you provide Expression Model to Google cloud disk,thanks very much. @YuvalNirkin

anhttran commented 4 years ago

The Expression Model is still downloadable. Check http://www.cbsr.ia.ac.cn/users/xiangyuzhu/projects/3DDFA/Code/3DDFA.zip and you can find it at /3DDFA_Release/Matlab/Model_Expression.mat

wuxiaolianggit commented 4 years ago

Thank you very much for your reply,Testing other pictures will lead to the following situation. How to solve it? image

image

wuxiaolianggit commented 4 years ago

Thank you very much for your reply. When testing other pictures, the above results will appear. How to solve them? image@ @anhttran

wuxiaolianggit commented 4 years ago

When testing other pictures, the above results will appear. How to solve them? @ @YuvalNirkin

wuxiaolianggit commented 4 years ago

image

When testing other pictures, the above results will appear. How to solve them? @iacopomasi

anhttran commented 4 years ago

I looks strange. Did you generate BaselFaceModel_mod.mat and BaselFaceModel_mod.h5 with trimBaselFace.py?

Can you try this code to make sure your mat file (and the h5 file respectively) is correct?

1) Add this function into utils.py

def projectBackExp(model,expr):
    expr = np.reshape(expr, model.expEV.shape)
    E = np.matmul(model.expPC, expr * model.expEV)
    numVert = int(E.shape[0]/3)
    return np.reshape(E,(numVert,3))

2) Run this code and check the output test.ply

import utils
import scipy.io
import numpy as np

BFM_path = '../3DMM_model/BaselFaceModel_mod.mat'
model = scipy.io.loadmat(BFM_path,squeeze_me=True,struct_as_record=False)
model = model["BFM"]
faces = model.faces-1

S,T = utils.projectBackBFM(model,np.zeros((198)))
gamma = np.zeros((29))
gamma[0] = -3
E = utils.projectBackExp(model,gamma)
utils.write_ply('test.ply', S+E, T, faces)
wuxiaolianggit commented 4 years ago

First of all, thank you very much for your reply,I did use trimBaselFace.py to generate BaselFaceModel_mod.mat and BaselFaceModel_mod.h5,I try to use the above methods to solve this problem. @anhttran