bearpaw/pytorch-pose

bug in pose/datasets/mpii.py and pose/losses/jointsmseloss.py

fabro66 opened this issue · 2 comments

Q1.in pose/datasets/mpii.py

1212

I think it should be if tpts[i, 2] > 0 not if tpts[i, 1] > 0, tpts[i, 2] indicates if the key point is visible.
The file of coco.py writes like this.

Q2.in pose/losses/jointsmseloss.py

Selection_044

target_weight[:, idx] should be target_weight[idx, 0]. Because target_weight[idx, 0] indicates if the key point is visible.
I don't know if I said it right, please take a look, thanks.

Q1.in pose/datasets/mpii.py

1212

I think it should be if tpts[i, 2] > 0 not if tpts[i, 1] > 0, tpts[i, 2] indicates if the key point is visible.
The file of coco.py writes like this.

Q2.in pose/losses/jointsmseloss.py

Selection_044

target_weight[:, idx] should be target_weight[idx, 0]. Because target_weight[idx, 0] indicates if the key point is visible.
I don't know if I said it right, please take a look, thanks.

Hi, I happen to browse the same parts of the code and my considerations are that:

For Q1, the "if" statement is no longer used to judge if the point is visible (you can simply delete the line). The original usage of the if statement is to create masked heatmaps for non-visible points, but here the publisher creates unmasked heatmaps for all of the joints by default, and implement training-time masking via the target_weight indicator in jointsmseloss. In test time, we should not mask the target heatmaps because the occluded joints are still required for calculating the accuracy.

For Q2, the target_weight is now a batch_sizenjoints1 tensor, and target_weight[ :, idx ] indicates the visibility of this joint for all of the samples in one batch.

what is njoints here do you have an idea.
In my model i have to regress for 6 coordinates and 1 confidence mask.
Is 6 be njoins in this case ?