Skip to content

Commit cd5d45f

Browse files
enable texture correction
1 parent 2260aa8 commit cd5d45f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

decalib/deca.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ def decode(self, codedict, name, rendering=True, iddict=None, vis_lmk=True, retu
440440

441441
### Texture Correction
442442

443-
'''angle1 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,3555,2205])
443+
angle1 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,3555,2205])
444444
angle2 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,723,3555])
445445
avg_ang = int((angle1+angle2)/2)
446446
avg_ang = 90-(360-avg_ang)
447447
correct_tex = tex_correction(uv_texture_gt[0].permute(1,2,0).detach().cpu(), avg_ang)
448-
uv_texture_gt = correct_tex.permute(2,0,1)[None,...].to('cuda')'''
448+
uv_texture_gt = correct_tex.permute(2,0,1)[None,...].to('cuda')
449449

450450
# uv_shading = self.render.add_SHlight(uv_detail_normals, codedict['light'])
451451

@@ -537,13 +537,13 @@ def decode(self, codedict, name, rendering=True, iddict=None, vis_lmk=True, retu
537537

538538
### Texture Correction
539539

540-
'''angle1 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,3555,2205])
540+
angle1 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,3555,2205])
541541
angle2 = mesh_angle(verts[0].detach().cpu().numpy(), [3572,723,3555])
542542
avg_ang = int((angle1+angle2)/2)
543543
avg_ang = 90-(360-avg_ang)
544544
correct_tex = tex_correction(uv_texture_gt[0].permute(1,2,0).detach().cpu(), avg_ang)
545545
uv_texture_gt = correct_tex.permute(2,0,1)[None,...].to('cuda')
546-
uv_texture_gt = uv_texture_gt[:,:3,:,:]*self.uv_face_eye_mask + (uv_texture[:,:3,:,:]*(1-self.uv_face_eye_mask))'''
546+
uv_texture_gt = uv_texture_gt[:,:3,:,:]*self.uv_face_eye_mask + (uv_texture[:,:3,:,:]*(1-self.uv_face_eye_mask))
547547

548548

549549
else:

0 commit comments

Comments
 (0)