face-vid2vid
face-vid2vid copied to clipboard
Keypoint prior loss function
Thank you for your work. May I ask why your keypoint prior loss function is slightly different from the one in the original paper?
In the paper (A.2), the keypoint prior loss function is:
However, yours in losses.py is:
loss = (
torch.max(0 * dist_mat, self.Dt - dist_mat).sum((1, 2)).mean()
+ torch.abs(kp_d[:, :, 2].mean(1) - self.zt).mean()
- kp_d.shape[1] * self.Dt
)
I was wondering why you subtracted kp_d.shape[1] * self.Dt
in the end.
For the distance matrix dist_mat
, its diagonal is zero. So self.Dt - dist_mat
produced many self.Dt
in its diagonal, which are summed into the loss and need to be thrown away.
I see now. Thank you for your prompt answer!