cleardusk/3DDFA_V2

The tri.pkl seems not correspond to bfm_noneck_v3.pkl well

wasahaiah opened this issue · 1 comments

The tri.pkl seems not corespond to bfm_noneck_v3.pkl. I obtain the mean face and the triangle index , by the following code:
bfm.py:

def exp_base_write(self, obj):
for i in range(1):
object_name = obj + str(i) + ".obj"
write_obj(object_name, self.u, self.w_exp[:,0], self.tri, self.bfm_param_mean, self.bfm_param_std)

tddfa_util.py:

def write_obj(obj_name, u_base, vertices, faces, param_mean, param_std):
if obj_name.split('.')[-1] != 'obj':
obj_name = obj_name + '.obj'
faces = faces.copy()
#vertices = vertices * param_mean[52:] + param_std[52:]
with open(obj_name, 'w') as f:
for i in np.arange(0, vertices.shape[0], 3):
f.write('v {} {} {}\n'.format(u_base[i,0], u_base[i+1,0], u_base[i+2,0]))
if u_base[i+2] == 0:
print("i: ", i)
for j in np.arange(faces.shape[0]):
f.write('f {}/{} {}/{} {}/{}\n'.format(
faces[j, 0], faces[j, 0],
faces[j, 1], faces[j, 1],
faces[j, 2], faces[j, 2]))

I get the obj file that seems not right which maybe caused by the file tri.pk
6342103889423

1

The problem is solved