# From Python
# It requires OpenCV installed for Python
import sys
import cv2
import os
from sys import platform
import argparse
try:
# Import Openpose (Windows/Ubuntu/OSX)
dir_path = os.path.dirname(os.path.realpath(__file__))
try:
# Windows Import
if platform == "win32":
# Change these variables to point to the correct folder (Release/x64 etc.)
# sys.path.append('D:/openpose-master/build/python/openpose/Release')
os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + './Release;' + dir_path + './bin;'
import pyopenpose as op
else:
# Change these variables to point to the correct folder (Release/x64 etc.)
# sys.path.append('../../python');
# If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it.
# sys.path.append('/usr/local/python')
from openpose import pyopenpose as op
except ImportError as e:
print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?')
raise e
# Flags
image_path = './media/COCO_val2014_000000000192.jpg'
parser = argparse.ArgumentParser()
parser.add_argument("--image_path", default=image_path, help="Process an image. Read all standard formats (jpg, png, bmp, etc.).")
args = parser.parse_known_args()
# Custom Params (refer to include/openpose/flags.hpp for more parameters)
params = dict()
params["model_folder"] = "./models/"
# Add others in path?
for i in range(0, len(args[1])):
curr_item = args[1][i]
if i != len(args[1])-1: next_item = args[1][i+1]
else: next_item = "1"
if "--" in curr_item and "--" in next_item:
key = curr_item.replace('-','')
if key not in params: params[key] = "1"
elif "--" in curr_item and "--" not in next_item:
key = curr_item.replace('-','')
if key not in params: params[key] = next_item
# Construct it from system arguments
# op.init_argv(args[1])
# oppython = op.OpenposePython()
# Starting OpenPose
opWrapper = op.WrapperPython()
opWrapper.configure(params)
opWrapper.start()
# Process Image
datum = op.Datum()
imageToProcess = cv2.imread(args[0].image_path)
datum.cvInputData = imageToProcess
opWrapper.emplaceAndPop(op.VectorDatum([datum]))
# Display Image
print("Body keypoints: \n" + str(datum.poseKeypoints))
cv2.imshow("OpenPose 1.7.0 - Tutorial Python API", datum.cvOutputData)
cv2.waitKey(0)
except Exception as e:
print(e)
sys.exit(-1)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于深度学习的OpenPose识别人体骨架点的python源代码 (102个子文件)
video.avi 1.33MB
getModels.bat 2KB
pose_iter_440000.caffemodel 199.58MB
pose_iter_160000.caffemodel 196.41MB
pose_iter_584000.caffemodel 99.86MB
cublasLt64_11.dll 206.36MB
cublas64_11.dll 126.46MB
opencv_world450d.dll 111.85MB
opencv_world450.dll 58.44MB
curand64_10.dll 52.94MB
libopenblas.dll 36.56MB
opencv_imgproc310.dll 24.39MB
opencv_videoio_ffmpeg450_64.dll 21.46MB
caffehdf5_D.dll 16.83MB
caffe-d.dll 14.57MB
opencv_core310.dll 10.54MB
caffe.dll 5.31MB
openpose.dll 3.56MB
openpose.dll 3.56MB
openpose.dll 3.56MB
python27.dll 3.25MB
opencv_imgcodecs310.dll 2.63MB
caffehdf5.dll 2.2MB
libgfortran-3.dll 1.22MB
gflagsd.dll 544KB
opencv_videoio_msmf450_64d.dll 432KB
cudart64_110.dll 422KB
libquadmath-0.dll 324KB
glogd.dll 319KB
boost_python-vc140-mt-1_61.dll 282KB
caffehdf5_hl_D.dll 224KB
cudnn64_8.dll 218KB
boost_filesystem-vc142-mt-gd-x64-1_74.dll 208KB
caffezlibd1.dll 197KB
boost_thread-vc142-mt-gd-x64-1_74.dll 174KB
gflags.dll 137KB
boost_filesystem-vc140-mt-1_61.dll 136KB
boost_filesystem-vc142-mt-x64-1_74.dll 115KB
boost_thread-vc140-mt-1_61.dll 113KB
glog.dll 112KB
opencv_videoio_msmf450_64.dll 108KB
caffehdf5_hl.dll 102KB
VCRUNTIME140.dll 86KB
libgcc_s_seh-1.dll 81KB
caffezlib1.dll 81KB
boost_thread-vc142-mt-x64-1_74.dll 71KB
boost_system-vc140-mt-gd-1_61.dll 42KB
VCRUNTIME140_1.dll 36KB
boost_chrono-vc140-mt-1_61.dll 33KB
boost_system-vc140-mt-1_61.dll 24KB
boost_date_time-vc142-mt-gd-x64-1_74.dll 15KB
boost_system-vc142-mt-gd-x64-1_74.dll 15KB
boost_system-vc142-mt-x64-1_74.dll 10KB
boost_date_time-vc142-mt-x64-1_74.dll 10KB
17012332.xml.example 825B
13_asynchronous_custom_input_output_and_datum.exe 592KB
tutorial_add_module_custom_post_processing.exe 584KB
18_synchronous_custom_all_and_datum.exe 583KB
tutorial_api_thread_2_user_input_processing_output_and_datum.exe 194KB
12_asynchronous_custom_output.exe 119KB
17_synchronous_custom_output.exe 119KB
11_asynchronous_custom_input_multi_camera.exe 112KB
08_heatmaps_from_image.exe 111KB
05_keypoints_from_images_multi_gpu.exe 111KB
09_keypoints_from_heatmaps.exe 111KB
07_hand_from_image.exe 109KB
06_face_from_image.exe 109KB
15_synchronous_custom_preprocessing.exe 107KB
16_synchronous_custom_postprocessing.exe 107KB
tutorial_api_thread_1_user_processing_function.exe 107KB
04_keypoints_from_images.exe 106KB
14_synchronous_custom_input.exe 106KB
10_asynchronous_custom_input.exe 106KB
03_keypoints_from_image.exe 103KB
OpenPoseDemo.exe 92KB
OpenPoseDemo.exe 92KB
OpenPoseDemo.exe 92KB
02_whole_body_from_image_default.exe 59KB
Calibration.exe 55KB
01_body_from_image_default.exe 55KB
pyopenpose.exp 21KB
pyopenpose.exp 21KB
.gitignore 50B
5.openpose识别人体骨架点.iml 405B
COCO_val2014_000000000192.jpg 225KB
ALL_BUILD.lastbuildstate 200B
pyopenpose.lib 27KB
pyopenpose.lib 27KB
ALL_BUILD.log 3B
pose_deploy_linevec.prototxt 45KB
pose_deploy_linevec.prototxt 45KB
pose_deploy.prototxt 41KB
pose_deploy_linevec_faster_4_stages.prototxt 31KB
demo.py 3KB
pyopenpose.cp39-win_amd64.pyd 392KB
pyopenpose.cp39-win_amd64.pyd 392KB
getModels.sh 1KB
workspace.xml 4KB
Project_Default.xml 634B
modules.xml 321B
共 102 条
- 1
- 2
qq_36666696
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页