deepcut-cnn icon indicating copy to clipboard operation
deepcut-cnn copied to clipboard

Problem in Demo

Open zhangfuyang opened this issue 6 years ago • 1 comments

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.

zhangfuyang avatar Oct 18 '17 13:10 zhangfuyang

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...

CamilleMaurice avatar Oct 20 '17 12:10 CamilleMaurice