Dear Sir/Madam,
I am writing in as there is currently an error when I tried to compile and run the code. The error is as follows:
–
Message=
Source=C:\Users\Justi\source\repos\OpenPose\OpenPose\OpenPose.py
StackTrace:
File “C:\Users\Justi\source\repos\OpenPose\OpenPose\OpenPose.py”, line 43, in (Current frame)
assert(args.dataset == “Hand”)
May I kindly seek your help on how I might be able to resolve this? Thank you. J
This is the official Github page GitHub - opencv/opencv: Open Source Computer Vision Library .
Best regards,
Justin
berak
May 4, 2021, 2:35pm
2
can you show your cmdline ? (how you run openpose.py )
there are mandatory arguments, such as --model
and --dataset
Hey Berak,
I only used the “python OpenPose\openpose.py” command as shown in the image on Microsoft Visual Studio Terminal.
Sorry for not knowing much about mandatory arguments as Python is rather new to me. Thank for your help in advance. J
Best regards,
Justin
assert(args.dataset == "Hand")
what do you suppose that means? does it want you to specify the “Hand” dataset? could you do that using a command line argument?
berak
May 5, 2021, 6:58am
5
we probably have to go ALL THE WAY BACK here…
did you realize, that you have to download a pretrained dnn model(+pbtxt) for this ?
depending on what you want to do, choose from here:
// it can be used for body pose detection, using either the COCO model(18 parts):
// http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel
// https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/openpose_pose_coco.prototxt
//
// or the MPI model(16 parts):
// http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/mpi/pose_iter_160000.caffemodel
// https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/openpose_pose_mpi_faster_4_stages.prototxt
//
// (to simplify this sample, the body models are restricted to a single person.)
//
//
// you can also try the hand pose model:
// http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel
// https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose/master/models/hand/pose_deploy.prototxt
if you’re all set up, you have to tell your script, which model you’ve chosen, and where to find it, like:
python openpose.py --dataset COCO --model pose_iter_440000.caffemodel --proto openpose_pose_coco.prototxt --input person.png
berak
May 5, 2021, 7:01am
6
imho, that’s a bad error msg.
“Hand” is only the fallback, if it did not find “COCO” or “MPI” in the datasets arg.
(but it makes it sound, as if it was the only option here)
it should rather do something like:
raise(Exception("none of 'COCO', 'MPI', or 'Hand' found in args.dataset"))
indeed, bad error message.
if they wanted to stick with assertions, they could use if... elif... else: assert False, "thing must be X, Y, or Z"