Traceback (most recent call last):
File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/hand.py", line 89, in
canvas = util.draw_handpose(oriImg, peaks, True)
File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/util.py", line 94, in draw_handpose
if np.sum(np.all(peaks[e], axis=1)==0)==0:
File "<__array_function__ internals>", line 6, in all
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 2398, in all
return _wrapreduction(a, np.logical_and, 'all', axis, None, out, keepdims=keepdims)
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
util.py
for peaks in all_hand_peaks:
for ie, e in enumerate(edges):
if np.sum(np.all(peaks[e], axis=1)==0)==0:
print(peaks[e])
x1, y1 = peaks[e[0]]
x2, y2 = peaks[e[1]]
ax.plot([x1, x2], [y1, y2], color=matplotlib.colors.hsv_to_rgb([ie/float(len(edges)), 1.0, 1.0]))
Traceback (most recent call last): File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/hand.py", line 89, in
canvas = util.draw_handpose(oriImg, peaks, True)
File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/util.py", line 94, in draw_handpose
if np.sum(np.all(peaks[e], axis=1)==0)==0:
File "<__array_function__ internals>", line 6, in all
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 2398, in all
return _wrapreduction(a, np.logical_and, 'all', axis, None, out, keepdims=keepdims)
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1
util.py
for peaks in all_hand_peaks: for ie, e in enumerate(edges): if np.sum(np.all(peaks[e], axis=1)==0)==0: print(peaks[e]) x1, y1 = peaks[e[0]] x2, y2 = peaks[e[1]] ax.plot([x1, x2], [y1, y2], color=matplotlib.colors.hsv_to_rgb([ie/float(len(edges)), 1.0, 1.0]))
当我运行hand.py的时候,出现上面的错误