Something went wrong while importing Openpose
mesakarghm opened this issue · 6 comments
While performing analysis on Video, I run into the following error. The app works with the pictures, the following problem arises only when video is selected.
Something went wrong when importing OpenPose
Debugging middleware caught exception in streamed response at a point where response headers were already sent.
Traceback (most recent call last):
File "C:\Users\Devil\AppData\Roaming\Python\Python37\site-packages\werkzeug\wsgi.py", line 506, in next
return self._next()
File "C:\Users\Devil\AppData\Roaming\Python\Python37\site-packages\werkzeug\wrappers\base_response.py", line 45, in _iter_encoded
for item in iterable:
File "D:\GritFeat\CV\AI-basketball-analysis-master\src\app_helper.py", line 19, in getVideoStream
datum, opWrapper = openpose_init()
File "D:\GritFeat\CV\AI-basketball-analysis-master\src\utils.py", line 47, in openpose_init
raise e
File "D:\GritFeat\CV\AI-basketball-analysis-master\src\utils.py", line 39, in openpose_init
import OpenPose.Release.pyopenpose as op
ModuleNotFoundError: No module named 'OpenPose.Release.pyopenpose'
Same problem, ubuntu 18.04.
I solve the problem. Compile the source (I use the release 1.7.0 and python 3.7) and then copy the compiled pyopenpose.cpython-37m-x86_64-linux-gnu.so to folder OpenPose/openpose
and change the code src/utils.py about Line 135 from
opWrapper.emplaceAndPop([datum])
to
opWrapper.emplaceAndPop(op.VectorDatum([datum]))
Please access my openpose blog for details.
Hi @xugaoxiang,
Thanks a lot for the information! I will update the instructions on my repo following your solution.
The compilation of OpenPose is always troublesome, I'm glad that you could figure out the solution.
It seems like there's no efficient way to share a project that included OpenPose, recompiling is always required.
This is a great project, thank you.
I solve the problem. Compile the source (I use the release 1.7.0 and python 3.7) and then copy the compiled pyopenpose.cpython-37m-x86_64-linux-gnu.so to folder OpenPose/openpose
and change the code src/utils.py about Line 135 from
opWrapper.emplaceAndPop([datum])
to
opWrapper.emplaceAndPop(op.VectorDatum([datum]))
Please access my openpose blog for details.
Thanks!
Note that app_helper.py also requires:
detection, trace = detect_shot(img, trace, width, height, sess, image_tensor, boxes, scores, classes,
num_detections, previous, during_shooting, shot_result, fig, datum, opWrapper, shooting_pose, op)
(The addition of an op arg)
which can be obtained by
datum, opWrapper, op = openpose_init()
(need to alter openpose_init for this)