Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Face Generator Training Loss Error #37

Open
Xiao-Fangff opened this issue Nov 9, 2024 · 0 comments
Open

Face Generator Training Loss Error #37

Xiao-Fangff opened this issue Nov 9, 2024 · 0 comments

Comments

@Xiao-Fangff
Copy link

The code is in nets/smplx_face.py#161

    def get_loss(
        self,
        pred_poses,
        gt_poses,
        pre_poses,
        aud,
        mode="training_G",
        gt_conf=None,
        exp=1,
        gt_nzero=None,
        pre_nzero=None,
    ):
        loss_dict = {}

        [b_j, b_e, b_b, b_h, b_f] = self.dim_list

        MSELoss = torch.mean(torch.abs(pred_poses[:, :, :6] - gt_poses[:, :, :6]))
        if self.expression:
            expl = torch.mean((pred_poses[:, :, -100:] - gt_poses[:, :, -100:]) ** 2)
        else:
            expl = 0

        gen_loss = expl + MSELoss

        loss_dict["MSELoss"] = MSELoss
        if self.expression:
            loss_dict["exp_loss"] = expl

        return gen_loss, loss_dict

The dimension of jaw is 3. So MSELoss = torch.mean(torch.abs(pred_poses[:, :, :6] - gt_poses[:, :, :6])) should be corrected to MSELoss = torch.mean(torch.abs(pred_poses[:, :, :3] - gt_poses[:, :, :3])) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant