Openpose: Guide to run as Restful API.

Created on 5 Dec 2019  Â·  3Comments  Â·  Source: CMU-Perceptual-Computing-Lab/openpose

I am having difficulty in running this package as a Webservice. Would appreciate if we could provide any kind of documentation on implementing an API to get the keypoints from an image. Our aim is to able to deploy this API as an Azure Function and also know if it is feasible.

clearly specified in doc help wantequestion

Most helpful comment

Hey people, coming from other programming languages I find this documentation really counter-intuitive. Is there any full example of an API working with openpose and python?

All 3 comments

@ran2207 to get something up and running quickly in python, you could set something up using flask (https://towardsdatascience.com/simple-way-to-deploy-machine-learning-models-to-cloud-fd58b771fdcf) and instead of loading the model, you would start the OpenPose framework and then inside a 'get_prediction' function you would put some code like:

# Process Image datum = op.Datum() imageToProcess = cv2.imread(args[0].image_path) datum.cvInputData = imageToProcess opWrapper.emplaceAndPop([datum])

and your api could respond with the keypoints:

datum.poseKeypoints

Hope this helps.

Hey people, coming from other programming languages I find this documentation really counter-intuitive. Is there any full example of an API working with openpose and python?

Was this page helpful?
0 / 5 - 0 ratings