mirror of
https://github.com/gosticks/openpose.git
synced 2026-08-12 20:30:20 +00:00
@@ -54,26 +54,30 @@ for i in range(0, len(args[1])):
|
||||
# op.init_argv(args[1])
|
||||
# oppython = op.OpenposePython()
|
||||
|
||||
# Starting OpenPose
|
||||
opWrapper = op.WrapperPython()
|
||||
opWrapper.configure(params)
|
||||
opWrapper.start()
|
||||
try:
|
||||
# Starting OpenPose
|
||||
opWrapper = op.WrapperPython()
|
||||
opWrapper.configure(params)
|
||||
opWrapper.start()
|
||||
|
||||
# Read image and face rectangle locations
|
||||
imageToProcess = cv2.imread(args[0].image_path)
|
||||
faceRectangles = [
|
||||
op.Rectangle(330.119385, 277.532715, 48.717274, 48.717274),
|
||||
op.Rectangle(24.036991, 267.918793, 65.175171, 65.175171),
|
||||
op.Rectangle(151.803436, 32.477852, 108.295761, 108.295761),
|
||||
]
|
||||
# Read image and face rectangle locations
|
||||
imageToProcess = cv2.imread(args[0].image_path)
|
||||
faceRectangles = [
|
||||
op.Rectangle(330.119385, 277.532715, 48.717274, 48.717274),
|
||||
op.Rectangle(24.036991, 267.918793, 65.175171, 65.175171),
|
||||
op.Rectangle(151.803436, 32.477852, 108.295761, 108.295761),
|
||||
]
|
||||
|
||||
# Create new datum
|
||||
datum = op.Datum()
|
||||
datum.cvInputData = imageToProcess
|
||||
datum.faceRectangles = faceRectangles
|
||||
# Create new datum
|
||||
datum = op.Datum()
|
||||
datum.cvInputData = imageToProcess
|
||||
datum.faceRectangles = faceRectangles
|
||||
|
||||
# Process and display image
|
||||
opWrapper.emplaceAndPop([datum])
|
||||
print("Face keypoints: \n" + str(datum.faceKeypoints))
|
||||
cv2.imshow("OpenPose 1.4.0 - Tutorial Python API", datum.cvOutputData)
|
||||
cv2.waitKey(0)
|
||||
# Process and display image
|
||||
opWrapper.emplaceAndPop([datum])
|
||||
print("Face keypoints: \n" + str(datum.faceKeypoints))
|
||||
cv2.imshow("OpenPose 1.4.0 - Tutorial Python API", datum.cvOutputData)
|
||||
cv2.waitKey(0)
|
||||
except Exception as e:
|
||||
# print(e)
|
||||
sys.exit(-1)
|
||||
|
||||
Reference in New Issue
Block a user