MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
8.06k stars 1.98k forks source link

Prediction on a single image with a custom scripts #1043

Closed erdemuysalx closed 2 years ago

erdemuysalx commented 2 years ago

Hi all,

I got my environment working, tested via demo_inference script.

My goal is to use AlphaPose for the list single images. To accomplish that; I imported demo_api.py as a module in my custom script where I am trying to run estimator in a loop after I cropped images one by one by calling SingleImageAlphaPose.process function.

I get following error:

Loading YOLO model..
FileNotFoundError(2, 'No such file or directory')
An error as above occurs when processing the images, please check it
[None]

The piece of code I put into the for loop as follows:

cropped_image = get_cropped_cam_img(
                                frame, cam, labels[label]
                            )

cv_image = np.array(
    cropped_image).astype(np.uint8)

pose = ap.process(image_name, cropped_image)

result = [pose]
print(result)
ap.writeJson(
    result,
    outputpath,
    # form=args.format,
    # for_eval=args.eval
)

What is the correct way of passing individual images to the process function of SingleImageAlphaPose class?

erdemuysalx commented 2 years ago

Custom script should be located in the AlphaPose repository.