Exception Thrown: assert(args.dataset == "Hand") Using OpenPose

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:

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,

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,

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?

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:

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

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"