Hzzone / pytorch-openpose

pytorch implementation of openpose including Hand and Body Pose Estimation.
2.02k stars 391 forks source link

ZeroDivisionError: float division by zero in body.py #42

Closed hankroldd closed 3 years ago

hankroldd commented 3 years ago

Thanks for your great work!

When I run the demo.py with a change of test_image = 'images/090932040.jpg', there is an error :

body.py:123: RuntimeWarning: invalid value encountered in true_divide
  vec = np.divide(vec, norm)
Traceback (most recent call last):
  File "demo.py", line 16, in <module>
    candidate, subset = body_estimation(oriImg)
  File "src\body.py", line 135, in __call__
    0.5 * oriImg.shape[0] / norm - 1, 0)
ZeroDivisionError: float division by zero

090932040

This is the image I used. Could you help me with the error?

PatrickChoDev commented 3 years ago

How did you fix this issue?

Adeel-Intizar commented 3 years ago

@hankroldd I am having same issue, can you kindly tell how did you solve it? Thank you

Adeel-Intizar commented 3 years ago

I managed to solve it, in case if anyone is looking for it, just add 1e-6 to the norm variable which is causing this error and the problem will be solved