sicxu / Deep3DFaceRecon_pytorch

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.
MIT License
1.7k stars 315 forks source link

visualize the face mesh without texture and color #163

Closed chenhao-user closed 1 year ago

chenhao-user commented 1 year ago

Hi! I'd like to know how to generate this kind of facial image below? image Based on my own understanding, I set the illumination to 1 in the compute_color function without multiplying it by the texture parameter. I made the following modification.

def compute_color(self, face_texture, face_norm, `gamma):
        gamma = torch.ones_like(gamma)
        .....
        face_color = torch.cat([r, g, b], dim=-1)
        .....

However, the results of this change were not satisfactory. One of the results is as follows: image

harlanhong commented 6 months ago

Hi, do you figure out this problem?

chenhao-user commented 6 months ago

I seem to have operated like this before, where 0.5 and 0.1 are values I tried out myself, but of course, you can also try other values. `face_texture = torch.full_like(face_texture, 0.5)

face_norm = self.compute_norm(face_shape)

face_norm_roted = face_norm @ rotation

face_gamma = torch.full_like(coef_dict['gamma'], 0.1)

face_color = self.compute_color(face_texture, face_norm_roted, face_gamma)`