DenisTome / Lifting-from-the-Deep-release

Implementation of "Lifting from the Deep: Convolutional 3D Pose Estimation from a Single Image"
https://denistome.github.io/papers/lifting-from-the-deep
GNU General Public License v3.0
450 stars 133 forks source link

Zero-size array error when running on some images #3

Closed GeorgianaPetria closed 7 years ago

GeorgianaPetria commented 7 years ago

I've used it on several images and, while some work perfectly, there are a couple of them that trigger a very weird error. Do you know why this might happen and how to fix this issue?

File "demo.py", line 67, in

pose3D = poseLifting.compute_3d(pose2D, weights)

File "/home/ubuntu/projects/Lifting-from-the-Deep-release/utils/prob_model.py", line 219, in compute_3d

norm_pose, _ = Prob3dPose.normalise_data(reg_joints, weights)

File "/home/ubuntu/projects/Lifting-from-the-Deep-release/utils/prob_model.py", line 100, in normalise_data

m2 = d2[:, 1, idx_consider].min(1) / 2.0

File "/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py", line 29, in _amin

return umr_minimum(a, axis, None, out, keepdims)

ValueError: zero-size array to reduction operation minimum which has no identity
DenisTome commented 7 years ago

The problem is related to zero visible joints detected in 2D. Changing the file utils/config.py and specifically the variable VISIBLE_PART can produce more 2D predictions (with more uncertainty though). I've added some controls in the code for which if the number of 2D joints is insufficient then it triggers an error (see commit)