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

Problem in Demo #18

Open
zhangfuyang opened this issue Oct 18, 2017 · 1 comment
Open

Problem in Demo #18

zhangfuyang opened this issue Oct 18, 2017 · 1 comment

Comments

@zhangfuyang
Copy link

I have followed all procedures in README. However, when I finally try to run the demo.py, I get an error.
IndexError: boolean index did not match indexed array along dimension 0; dimension is 0 but corresponding boolean dimension is 16

I notice that an issue is similar with my problem, but I meet this error with the demo picture (image.png), so do someone can help me? Really appreciated.

@CamilleMaurice
Copy link

CamilleMaurice commented Oct 20, 2017

I have this issue when compiling caffe with CPU_ONLY := 1 in the Makefile.config.
Then I call python ./pose_demo.py image.png --use_cpu --out_name=prediction

And I encounter the same error :
File "./pose_demo.py", line 37, in _npcircle
image[cy-radius:cy+radius, cx-radius:cx+radius][index].astype('float32') * transparency +
IndexError: boolean index did not match indexed array along dimension 0; dimension is 0 but corresponding boolean dimension is 16

The problem is in def _npcircle(image, cx, cy, radius, color, transparency=0.0):
And I found out that the values cx and cy are for all the 14 joints : cx = 4, cy = 4 and the radius is set to 8.
So image[cy-radius:cy+radius, cx-radius:cx+radius] is trying to access something out of the image. So my quick fix (which does not really solve the problem in the case the detected joints are on the image border) is the following :
from pose_demo.py
line136
_npcircle(visim,
pose[0, p_idx],
pose[1, p_idx],
2, # I replace 8 by 2 for the radius value !
colors[p_idx],
0.0)
I found out that the values cx = 4 and cy = 4 are related to the value of _STRIDE = 8.
So now my main concerns is that is does not give me the actual joints coordinates ! What about you ?
PS : I run CPU_ONLY because I have a "Out of Memory error" otherwise...

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