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

To compute RecLoss, why do you compute outer_interocular_dist? Why do not you use bbox_size in KptNME2D directly? #13

Closed
lhyfst opened this issue Nov 7, 2021 · 1 comment

Comments

@lhyfst
Copy link

lhyfst commented Nov 7, 2021

To compute RecLoss, why do you compute outer_interocular_dist?

SADRNet/src/model/loss.py

Lines 353 to 359 in a5e6fac

outer_interocular_dist = y_true[uv_kpt_ind[36, 0], uv_kpt_ind[36, 1]] - y_true[
uv_kpt_ind[45, 0], uv_kpt_ind[45, 1]]
bbox_size = np.linalg.norm(outer_interocular_dist[0:3])
dist = torch.from_numpy(dist)
# loss = np.mean(dist / bbox_size)
loss = torch.mean(dist / bbox_size)

Why do not you use bbox_size in KptNME2D directly?

SADRNet/src/model/loss.py

Lines 255 to 260 in a5e6fac

left = torch.min(gt[:, 0, :], dim=1)[0]
right = torch.max(gt[:, 0, :], dim=1)[0]
top = torch.min(gt[:, 1, :], dim=1)[0]
bottom = torch.max(gt[:, 1, :], dim=1)[0]
bbox_size = torch.sqrt((right - left) * (bottom - top))
dist = dist / bbox_size

@reshow
Copy link
Collaborator

reshow commented Nov 8, 2021

"RecLoss" is not used for training but for evaluation. We follow the evaluation metrics of PRNet and use outer_interocular_dist to evaluate face reconstruction.

@lhyfst lhyfst closed this as completed Nov 8, 2021
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

2 participants