mirror of
https://github.com/gosticks/openpose.git
synced 2026-08-16 06:10:25 +00:00
@@ -52,28 +52,32 @@ 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 frames on directory
|
||||
imagePaths = op.get_images_on_directory(args[0].image_dir);
|
||||
start = time.time()
|
||||
# Read frames on directory
|
||||
imagePaths = op.get_images_on_directory(args[0].image_dir);
|
||||
start = time.time()
|
||||
|
||||
# Process and display images
|
||||
for imagePath in imagePaths:
|
||||
datum = op.Datum()
|
||||
imageToProcess = cv2.imread(imagePath)
|
||||
datum.cvInputData = imageToProcess
|
||||
opWrapper.emplaceAndPop([datum])
|
||||
# Process and display images
|
||||
for imagePath in imagePaths:
|
||||
datum = op.Datum()
|
||||
imageToProcess = cv2.imread(imagePath)
|
||||
datum.cvInputData = imageToProcess
|
||||
opWrapper.emplaceAndPop([datum])
|
||||
|
||||
print("Body keypoints: \n" + str(datum.poseKeypoints))
|
||||
print("Body keypoints: \n" + str(datum.poseKeypoints))
|
||||
|
||||
if not args[0].no_display:
|
||||
cv2.imshow("OpenPose 1.4.0 - Tutorial Python API", datum.cvOutputData)
|
||||
key = cv2.waitKey(15)
|
||||
if key == 27: break
|
||||
if not args[0].no_display:
|
||||
cv2.imshow("OpenPose 1.4.0 - Tutorial Python API", datum.cvOutputData)
|
||||
key = cv2.waitKey(15)
|
||||
if key == 27: break
|
||||
|
||||
end = time.time()
|
||||
print("OpenPose demo successfully finished. Total time: " + str(end - start) + " seconds")
|
||||
end = time.time()
|
||||
print("OpenPose demo successfully finished. Total time: " + str(end - start) + " seconds")
|
||||
except Exception as e:
|
||||
# print(e)
|
||||
sys.exit(-1)
|
||||
|
||||
Reference in New Issue
Block a user