-
OpenPose人体姿态识别项目Windows7环境VS2015编译配置记录
2019-11-05 16:53:27OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)开发的开源库。代码开源已经有相当一段时间了,各位博主博客的经验也很丰富,但由于版本关系,新版本的部署方式和之前有些不同。 本文仅记录win7下编译配置...目录
写在前面:
OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)开发的开源库。代码开源已经有相当一段时间了,各位博主博客的经验也很丰富,但由于版本关系,新版本的部署方式和之前有些不同。
本文仅记录win7 下编译配置过程。
参考:【OpenPose-Windows】OpenPose+VS2015+Windows+CUDA8+cuDNN5.1 官方配置教程
1、准备工作:
环境准备:
- VS2015 with update3
- cuda10.0, 下载地址
- cudnn7。下载地址 注意下载对应cuda的版本,下载后解压,把解压后的三个文件夹直接拷贝<cuda安装目录>Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\里,覆盖即可。
- cmake 下载地址
源码下载:
openpose项目github主页: https://github.com/CMU-Perceptual-Computing-Lab/openpose
各发布版本:https://github.com/CMU-Perceptual-Computing-Lab/openpose/releases
我们从发布版本中下载,当前最新为V1.5.1,
目录里还有openpose-1.5.1-binaries-win64... zip等,是已经编译好的,如果不想自己编译,(边缘还是比较简单的), 可以直接下载使用。
本文下载源码ZIP压缩包,下载后解压,解压目录 “E:\code2019\new_alg\OpenPose\”。
2、编译
打开cmake-gui,设置
源路径:“E:/code2019/new_alg/OpenPose/openpose-1.5.1”
生成路径:“E:/code2019/new_alg/OpenPose/openpose-1.5.1/windows”
点击config,编译器本文选了了" visual Studio 14 2015 win64"
这个过程时间有点长,会下载依赖的文件和检测需要的模型,之前的版本是手动使用脚本下载。
config完成后,跳出一个喜庆的大红的界面,重点看一下里面CUDA_开头的项。
我电脑上装了多个cuda版本,所以CUDA_ARCH修改为了手动,CUDA_TOOLKIT_ROOT_DIR指定路径为“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0”。
再次点击config,完成后点击 Generate。
生成完毕后,打开生成的文件夹,里面bin目录里有运行环境所依赖的动态库,包括boost,caffe,cuda,cudnn等,通过文件名可以看出,默认cuda版本为10.0,cudnn版本为7。
用vs2015打开工程,生成ALL_BUILD。
编译完成后,先将<工程目录>\x64\Release文件夹内的所有文件拷贝到<工程目录>bin文件夹内。
然后将<工程目录>bin目录整个拷贝到外层文件夹,本文为“E:\code2019\new_alg\OpenPose\openpose-1.5.1”目录。测试用到了这个目录的“models”和“examples”文件夹内容。
注意一共拷贝了两次。
3、测试:
打开cmd.exe命令行,目录切换至“E:\code2019\new_alg\OpenPose\openpose-1.5.1”
测试视频:
bin\OpenPoseDemo.exe --video examples\media\video.avi bin\OpenPoseDemo.exe --video examples\media\video.avi --face --hand
我的显卡是:Geforce gtx 745, 只检测关键点,帧率1.4
换个比较好GPU的服务器运行,速度提升还是很明显的,帧率达到了12帧
测试图片:
bin\OpenPoseDemo.exe --image_dir examples\media\ bin\OpenPoseDemo.exe --image_dir examples\media\ --face --hand
-
OpenPose人体姿态识别库中文帮助文档.pdf
2021-02-18 11:50:03适合用c++或者python的小伙伴来学习 -
If you want to use OpenPose without installing or writing any code, simply download and use the latest Windows portable version of OpenPose! Otherwise, you could build OpenPose from source. See the ...
-
-
openpose人体姿态识别开源代码在ubuntu下配置CPU版CAFFE,并运行代码全过程
2021-02-02 11:42:00 -
tfpose与openpose区别_tf-pose-estimation-master OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)...
2021-01-11 22:47:07master/etcs/loss_ll_paf.png tf-pose-estimation-master/etcs/openpose_macbook13_mobilenet2.gif tf-pose-estimation-master/etcs/openpose_macbook_cmu.gif tf-pose-estimation-master/etcs/openpose_macbook_...压缩包 : a3e7eacaf0843d216b9d53a2f46b121.zip 列表
tf-pose-estimation-master/
tf-pose-estimation-master/.dockerignore
tf-pose-estimation-master/.gitattributes
tf-pose-estimation-master/.gitignore
tf-pose-estimation-master/CMakeLists.txt
tf-pose-estimation-master/Dockerfile
tf-pose-estimation-master/LICENSE
tf-pose-estimation-master/README.md
tf-pose-estimation-master/__init__.py
tf-pose-estimation-master/docker/
tf-pose-estimation-master/docker/Dockerfile
tf-pose-estimation-master/docker/README.md
tf-pose-estimation-master/etcs/
tf-pose-estimation-master/etcs/dance.mp4
tf-pose-estimation-master/etcs/experiments.md
tf-pose-estimation-master/etcs/feature.md
tf-pose-estimation-master/etcs/imgcat0.gif
tf-pose-estimation-master/etcs/inference_result2.png
tf-pose-estimation-master/etcs/loss_ll_heat.png
tf-pose-estimation-master/etcs/loss_ll_paf.png
tf-pose-estimation-master/etcs/openpose_macbook13_mobilenet2.gif
tf-pose-estimation-master/etcs/openpose_macbook_cmu.gif
tf-pose-estimation-master/etcs/openpose_macbook_mobilenet3.gif
tf-pose-estimation-master/etcs/openpose_p40_cmu.gif
tf-pose-estimation-master/etcs/openpose_p40_mobilenet.gif
tf-pose-estimation-master/etcs/openpose_tx2_mobilenet3.gif
tf-pose-estimation-master/etcs/ros.md
tf-pose-estimation-master/etcs/training.md
tf-pose-estimation-master/images/
tf-pose-estimation-master/images/COCO_val2014_000000000357.jpg
tf-pose-estimation-master/images/apink1.jpg
tf-pose-estimation-master/images/apink1_crop.jpg
tf-pose-estimation-master/images/apink1_crop_s1.jpg
tf-pose-estimation-master/images/apink2.jpg
tf-pose-estimation-master/images/apink3.jpg
tf-pose-estimation-master/images/cat.jpg
tf-pose-estimation-master/images/golf.jpg
tf-pose-estimation-master/images/hand1.jpg
tf-pose-estimation-master/images/hand1_small.jpg
tf-pose-estimation-master/images/hand2.jpg
tf-pose-estimation-master/images/handsup1.jpg
tf-pose-estimation-master/images/p1.jpg
tf-pose-estimation-master/images/p2.jpg
tf-pose-estimation-master/images/p3.jpg
tf-pose-estimation-master/images/p3_dance.png
tf-pose-estimation-master/images/ski.jpg
tf-pose-estimation-master/images/valid_person1.jpg
tf-pose-estimation-master/launch/
tf-pose-estimation-master/launch/demo_video.launch
tf-pose-estimation-master/models/
tf-pose-estimation-master/models/__init__.py
tf-pose-estimation-master/models/graph/
tf-pose-estimation-master/models/graph/cmu/
tf-pose-estimation-master/models/graph/cmu/__init__.py
tf-pose-estimation-master/models/graph/cmu/download.sh
tf-pose-estimation-master/models/graph/mobilenet_thin/
tf-pose-estimation-master/models/graph/mobilenet_thin/__init__.py
tf-pose-estimation-master/models/graph/mobilenet_thin/graph.pb
tf-pose-estimation-master/models/graph/mobilenet_thin/graph_freeze.pb
tf-pose-estimation-master/models/graph/mobilenet_thin/graph_opt.pb
tf-pose-estimation-master/models/numpy/
tf-pose-estimation-master/models/numpy/download.sh
tf-pose-estimation-master/models/pretrained/
tf-pose-estimation-master/models/pretrained/mobilenet_v1_0.50_224_2017_06_14/
tf-pose-estimation-master/models/pretrained/mobilenet_v1_0.50_224_2017_06_14/download.sh
tf-pose-estimation-master/models/pretrained/mobilenet_v1_0.75_224_2017_06_14/
tf-pose-estimation-master/models/pretrained/mobilenet_v1_0.75_224_2017_06_14/download.sh
tf-pose-estimation-master/models/pretrained/mobilenet_v1_1.0_224_2017_06_14/
tf-pose-estimation-master/models/pretrained/mobilenet_v1_1.0_224_2017_06_14/download.sh
tf-pose-estimation-master/models/pretrained/resnet_v2_101/
tf-pose-estimation-master/models/pretrained/resnet_v2_101/download.sh
tf-pose-estimation-master/msg/
tf-pose-estimation-master/msg/BodyPartElm.msg
tf-pose-estimation-master/msg/Person.msg
tf-pose-estimation-master/msg/Persons.msg
tf-pose-estimation-master/package.xml
tf-pose-estimation-master/requirements.txt
tf-pose-estimation-master/run.py
tf-pose-estimation-master/run_checkpoint.py
tf-pose-estimation-master/run_directory.py
tf-pose-estimation-master/run_video.py
tf-pose-estimation-master/run_webcam.py
tf-pose-estimation-master/scripts/
tf-pose-estimation-master/scripts/broadcaster_ros.py
tf-pose-estimation-master/scripts/visualization.py
tf-pose-estimation-master/setup.py
tf-pose-estimation-master/tf_pose/
tf-pose-estimation-master/tf_pose/__init__.py
tf-pose-estimation-master/tf_pose/common.py
tf-pose-estimation-master/tf_pose/datum_pb2.py
tf-pose-estimation-master/tf_pose/estimator.py
tf-pose-estimation-master/tf_pose/eval.py
tf-pose-estimation-master/tf_pose/network_base.py
tf-pose-estimation-master/tf_pose/network_cmu.py
tf-pose-estimation-master/tf_pose/network_dsconv.py
tf-pose-estimation-master/tf_pose/network_mobilenet.py
tf-pose-estimation-master/tf_pose/network_mobilenet_thin.py
tf-pose-estimation-master/tf_pose/network_personlab.py
tf-pose-estimation-master/tf_pose/networks.py
tf-pose-estimation-master/tf_pose/pafprocess/
tf-pose-estimation-master/tf_pose/pafprocess/README.md
tf-pose-estimation-master/tf_pose/pafprocess/__init__.py
tf-pose-estimation-master/tf_pose/pafprocess/numpy.i
tf-pose-estimation-master/tf_pose/pafprocess/pafprocess.cpp
tf-pose-estimation-master/tf_pose/pafprocess/pafprocess.h
tf-pose-estimati
-
openpose人体姿态估计
2020-03-23 19:12:29OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首...人体姿态识别模型—openpose
OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首个基于深度学习的实时多人二维姿态估计应用。
参考:Github开源人体姿态识别项目OpenPose中文文档
OpenPose项目Github链接:https://github.com/CMU-Perceptual-Computing-Lab/openposeopenpose模型有:手,脸,人体姿态。如图:
CoCo人体18点检测-图片
import cv2 import matplotlib.pyplot as plt #配置文件 protoFile = './models/pose/coco/pose_deploy_linevec.prototxt' weightsfile = './models/pose/coco/pose_iter_440000.caffemodel' npoints = 18 POSE_PAIRS = [[1,0],[1,2],[1,5],[2,3],[3,4],[5,6],[6,7],[1,8],[8,9],[9,10],[1,11],[11,12],[12,13],[0,14],[0,15],[14,16],[15,17]] #加载网络 net = cv2.dnn.readNetFromCaffe(protoFile,weightsfile) #读取图片 im = cv2.imread('kai.jpg') #(1440*1080) im = cv2.cvtColor(im,cv2.COLOR_BGR2RGB) inHeight = im.shape[0] #1440 inWidth = im.shape[1] #1080 netInputsize = (368,368) #转为inpBlob格式 inpBlob = cv2.dnn.blobFromImage(im,1.0/255,netInputsize,(0,0,0),swapRB=True,crop=False) #归一化后的图片最为输入传入net网络,然后输出 net.setInput(inpBlob) output = net.forward() #1*57*46*46 # plt.figure(figsize=(20,10)) # for i in range(npoints): # probMap = output[0,i,:,:] #把18个output[2][3]输出出来 probMap.shape(46*46) # displayMap = cv2.resize(probMap,(inWidth,inHeight),cv2.INTER_LINEAR) #1440*1080 # plt.subplot(3,6,i+1);plt.axis('on'); # plt.imshow(displayMap,cmap='jet') # plt.show() scaleX = float(inWidth) / output.shape[3] #float(1080)/64 = 23.47826086956522 scaleY = float(inHeight)/ output.shape[2] #float(1440)/64 = 31.304347826086957 points = [] threshold = 0.1 for i in range(npoints): probMap = output[0,i,:,:] #shape(46*46) minVal,prob,minLoc,point =cv2.minMaxLoc(probMap) x = scaleX * point[0] y = scaleY * point[1] if prob > threshold: points.append((int(x),int(y))) else: points.append(None) #points[]最后为18个关键点的坐标 #[(516, 313), (516, 438), (399, 438), (375, 626), (352, 751), (610, 438), (633, 594), (657, 751), (446, 751), # (446, 970), (446, 1158), (563, 782), (540, 1001), (540, 1064), (493, 281), (540, 281), (446, 313), (563, 313)] imPoints = im.copy() imSkeleton = im.copy() for i,p in enumerate(points): #enumerate把points的值前面带上索引i cv2.circle(imPoints,p,8,(255,255,0),thickness=1,lineType=cv2.FILLED) cv2.putText(imPoints,'{}'.format(i),p,cv2.FONT_HERSHEY_SIMPLEX,1,(255,0,0),2,lineType=cv2.LINE_AA) for pair in POSE_PAIRS: partA = pair[0] partB = pair[1] #if points[partA] and points[partB]: cv2.line(imSkeleton,points[partA],points[partB],(255, 255,0),2) cv2.circle(imSkeleton, points[partA],8,(255,0,0),thickness=-1, lineType=cv2.FILLED) plt.figure(figsize=(20,10)) plt.subplot(121) plt.axis('off');plt.imshow(imPoints) plt.subplot(122) plt.axis('off');plt.imshow(imSkeleton) plt.show()
检测结果:
CoCo人体18点检测-视频
把上述代码改为由opencv捕获摄像头,实时进行人体姿态检测
import cv2 def detect(img): protoFile = './models/pose/coco/pose_deploy_linevec.prototxt' weightsfile = './models/pose/coco/pose_iter_440000.caffemodel' npoints = 18 POSE_PAIRS = [[1, 0], [1, 2], [1, 5], [2, 3], [3, 4], [5, 6], [6, 7], [1, 8], [8, 9], [9, 10], [1, 11], [11, 12], [12, 13], [0, 14], [0, 15], [14, 16], [15, 17]] net = cv2.dnn.readNetFromCaffe(protoFile, weightsfile) inHeight = img.shape[0] # 1440 inWidth = img.shape[1] # 1080 netInputsize = (368, 368) inpBlob = cv2.dnn.blobFromImage(img, 1.0 / 255, netInputsize, (0, 0, 0), swapRB=True, crop=False) net.setInput(inpBlob) output = net.forward() scaleX = float(inWidth) / output.shape[3] scaleY = float(inHeight) / output.shape[2] points = [] threshold = 0.1 for i in range(npoints): probMap = output[0, i, :, :] # shape(46*46) minVal, prob, minLoc, point = cv2.minMaxLoc(probMap) x = scaleX * point[0] y = scaleY * point[1] if prob > threshold: points.append((int(x), int(y))) else: points.append(None) for i, p in enumerate(points): # enumerate把points的值前面带上索引i cv2.circle(img, p, 8, (255, 255, 0), thickness=1, lineType=cv2.FILLED) cv2.putText(img, '{}'.format(i), p, cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0), 2, lineType=cv2.LINE_AA) cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() detect(frame) cv2.imshow('frame',frame) if cv2.waitKey(1) & 0xFF == ord('q'): # 按‘q’退出 break
检测结果:
距离计算
为了检测驾驶员是否存在吸烟和打电话等危险行为,可以计算人体特定关键点之间的距离。
吸烟:右手到鼻子的距离或者左手到鼻子的距离。
打电话:右手到右耳的距离或者左手到左耳的距离。import math def __distance(A,B): if A is None or B is None: return 0 else: return math.sqrt((A[0]-B[0])**2 + (A[1]-B[1])**2) distance0 = __distance(points[0],points[4]) #右手到鼻子距离 distance1 = __distance(points[0],points[7]) #左手到鼻子距离 distance2 = __distance(points[4],points[16]) #右手到右耳距离 distance3 = __distance(points[7],points[17]) #左手到左耳距离 print('右手到鼻子距离:',distance0,'左手到鼻子距离:',distance1) print('右手到右耳距离:',distance2,'左手到左耳距离:',distance3
计算结果
右手到鼻子距离: 467.6964827748868 左手到鼻子距离: 460.135849505339 右手到右耳距离: 447.97321348491363 左手到左耳距离: 447.97321348491363
-
openpose安装windows_人体姿态识别OpenPose
2020-11-25 16:15:14软硬件环境windows 10 64bitcuda 10.1cudnn 7.6.35anaconda with python 3.7ubuntu 18.04 64bitNVidia GTX 1070Ticmake 3.18.4protobuf 3.8.0简介OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经... -
人体识别_人体姿态识别OpenPose
2021-01-12 13:49:13软硬件环境windows 10 64bitcuda 10.1cudnn 7.6.35anaconda with python 3.7ubuntu 18.04 64bitNVidia GTX 1070Ticmake 3.18.4protobuf 3.8.0简介OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经... -
人体姿态识别OpenPose相关资料
2019-04-24 16:42:40OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首... -
【OpenPose】人体姿态识别项目OpenPose中文文档
2019-11-27 16:40:52https://www.jianshu.com/p/3aa810b35a5d -
【OpenPose】tensorflow版OpenPose进行人体姿态识别指南
2019-01-04 09:46:26环境:Ubuntu16.04 Anaconda3 tensorflow 1.9.0 CUDA 9.0 首先安装tensorflow gpu版本,具体过程请参考链接【Tensorflow】(一):环境配置(Anaconda)。 ...CUDA的安装过程请参考链接:【CUDA】linux ubuntu... -
python人体识别_Github开源人体姿态识别项目OpenPose中文文档
2020-12-14 19:55:04OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首个... -
Github开源人体姿态识别项目OpenPose中文文档
2020-10-26 22:21:11OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首... -
Win10 下安装 OpenPose(人体姿态识别)详细步骤
2020-12-08 15:31:15前言 起初我想在 Ubuntu 虚拟机上安装 OpenPose,但是虚拟机需要各种设置,第一步安装显卡驱动,就把我打败了,百度了好久都不能在虚拟机上安装显卡驱动,而网上的各种 Ubuntu 安装 OpenPose 是基于已有物理引擎上... -
人体姿态识别OpenPose
2020-10-27 08:08:38软硬件环境 windows 10 64bit cuda 10.1 cudnn 7.6.35 anaconda with python 3.7 ubuntu 18.04 64bit NVidia GTX 1070Ti cmake 3.18.4 protobuf 3.8.0 简介 OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于... -
python人体动作识别_人体姿态识别--Openpose+Tensorflow
2020-12-05 08:36:43目的复现代码完成视频中的人体姿态识别复现过程 -
人体姿态识别有个openpose的开源项目
2020-10-26 22:09:11人体姿态识别有个openpose的开源项目 。 -
人体识别_人体姿态识别--Openpose+Tensorflow
2020-12-28 19:37:15目的复现代码完成视频中的人体姿态识别复现过程项目地址:https://github.com/ildoonet/tf-pose-estimation如果clone速度非常慢,可以下载国内镜像:https://gitee.com/zhongshangwu/tf-pose-estimation视频来源:... -
OpenCV实现人体姿态估计(人体关键点检测)OpenPose
2019-08-04 11:53:03OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络和监督学习并以Caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿态估计。适用于单人和多人,具有极好的鲁棒性。是世界上首... -
ubuntu下人体姿态识别OpenPose编译运行
2020-11-30 16:18:401、项目gayhub:https://github.com/CMU-Perceptual-Computing-Lab/openpose 2、官方BVLC版本Caffe:https://github.com/BVLC/caffe 3、openpose指定的CMU版本Caffe:... -
用OpenPose进行单个或多个人体姿态估计
2020-04-02 13:37:55在计算机视觉中,人体姿态估计(关键点...OpenPose人体姿态识别项目是美国卡耐基梅隆大学(CMU)基于卷积神经网络(CNN)和监督学习(SL)并以Caffe为框架开发的开源库。可以实现人体动作、面部表情、手指运动等姿... -
Openpose2d转换3d姿态识别
2019-08-19 12:28:26最近笔者遇到一个问题就是openpose在对于姿态识别的时候,识别出的人体姿态是一个2d平面姿态。对于AR交互应用来说,2d姿态是不如3d姿态的。当然可以使用kinect深度摄像头或者开源项目vnect实现3d的实时姿态识别。... -
tfpose与openpose区别_人体姿态识别--Openpose+Tensorflow
2021-01-30 10:51:42目的复现代码完成视频中的人体姿态识别复现过程视频来源:https://www.youtube.com/watch?v=cMhWNGBW1Xgwww.youtube.com视频动图检测结果下载的画质本来就不高,再加上两次录屏,画质比较渣。首先确认工程所需要的... -
Openpose Deeplab V3 tensorflow 实现 人体 姿态识别 动作识别 语义分割人物 骨架坐标显示
2019-05-02 09:07:37实现效果 Deeplab V3 Openpsoe ...动作识别 ...人体关键坐标显示 动作识别判断 有时间整理代码,分享。 TF OPENPOSE 安装过程 TF GIT 相关包 requirement PAF后处理编译 ...