fix repro_smpl projectN3 error

when vis repro_smpl, the kpts3d shape is [x,x,3], it has no visibility,it has xyz only, use z maybe lost some point in repro_smpl.
This commit is contained in:
linyu0219 2022-06-10 16:58:05 +08:00 committed by James Cotton
parent 251b2671dd
commit 6475cbec41

View File

@ -24,7 +24,8 @@ def projectN3(kpts3d, Pall):
kp2d[:2, :] /= kp2d[2:, :]
kp2ds.append(kp2d.T[None, :, :])
kp2ds = np.vstack(kp2ds)
kp2ds[..., -1] = kp2ds[..., -1] * (kpts3d[None, :, -1] > 0.)
if kpts3d.shape[-1] == 4:
kp2ds[..., -1] = kp2ds[..., -1] * (kpts3d[None, :, -1] > 0.)
return kp2ds
def simple_reprojection_error(kpts1, kpts1_proj):
@ -113,4 +114,4 @@ def check_limb(keypoints3d, limb_means, thres=0.5):
break
# 至少两段骨头可以使用
valid = valid and cnt > 2
return valid
return valid