Created
November 16, 2019 07:42
-
-
Save ledmonster/2d0c2f2e1f493d27a99c9f1784b57763 to your computer and use it in GitHub Desktop.
openpose sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.append('/usr/local/python') | |
import cv2 | |
from openpose import pyopenpose as op | |
def main(): | |
params = { | |
"model_folder": "/Users/junya/work/openpose/models/", | |
} | |
# Starting OpenPose | |
opWrapper = op.WrapperPython() | |
opWrapper.configure(params) | |
opWrapper.start() | |
# Process Image | |
datum = op.Datum() | |
imageToProcess = cv2.imread("/Users/junya/Pictures/Profile/200511_junya.jpg") | |
datum.cvInputData = imageToProcess | |
opWrapper.emplaceAndPop([datum]) | |
# Display Image | |
print("Body keypoints: \n" + str(datum.poseKeypoints)) | |
cv2.imshow("OpenPose 1.5.1 - Tutorial Python API", datum.cvOutputData) | |
cv2.waitKey(0) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment