基于 Openpose 实现人体动作识别


系统组成



myfont = ImageFont.truetype(r'C:/Windows/SIMLI.TTF', 20)
parser = argparse.ArgumentParser(description='tf-pose-estimation run')
parser.add_argument('--image', type=str, default='Standard/1.jpg')
parser.add_argument('--model', type=str, default='cmu',
help='cmu / mobilenet_thin / mobilenet_v2_large / mobilenet_v2_small')
parser.add_argument('--resize', type=str, default='0x0',
help='if provided, resize images before they are processed. '
'default=0x0, Recommends : 432x368 or 656x368 or 1312x736 ')
parser.add_argument('--resize-out-ratio', type=float, default=4.0,
help='if provided, resize heatmaps before they are post-processed. default=1.0')
args = parser.parse_args()
update_a = ["", "", "", "", "", "", "", "", "", ""]
w, h = model_wh(args.resize)
if w == 0 or h == 0:
e = TfPoseEstimator(get_graph_path(args.model), target_size=(432, 368))
else:
e = TfPoseEstimator(get_graph_path(args.model), target_size=(w, h))
cap=cv2.VideoCapture("shuaidao.mp4")
conditions=[5,6]
num=0
image3 = np.zeros([600, 480, 3])
image3.fill(255)
cv2.imwrite("iimg3.jpg", image3)
image3 = cv2.imread("iimg3.jpg")
image_web4=cv2.resize(image3,(800,480))
image3 = Image.fromarray(cv2.cvtColor(image3, cv2.COLOR_BGR2RGB))
draw = ImageDraw.Draw(image3)
dates = str(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
draw.text((10, 10), "系统日志:" + dates, font=myfont, fill=(255, 0, 0))
image3 = cv2.cvtColor(np.asarray(image3), cv2.COLOR_RGB2BGR)




分享

点收藏

点点赞

点在看
关注公众号:拾黑(shiheibook)了解更多
[广告]赞助链接:
四季很好,只要有你,文娱排行榜:https://www.yaopaiming.com/
让资讯触达的更精准有趣:https://www.0xu.cn/

随时掌握互联网精彩
赞助链接
排名
热点
搜索指数
- 1 铁肩担道义 历史鉴未来 7904574
- 2 中方对会谈结果满意吗?外交部回应 7809586
- 3 40℃高温要来了 7714267
- 4 中国经济必将破浪前行 7617906
- 5 中美双方降低超100%关税 7520639
- 6 英国首相斯塔默住所起火 7427652
- 7 李嘉诚卖港口 长和发布声明回应 7329419
- 8 雪碧悄悄换了配方?售后人员回应 7233595
- 9 黄晓明金世佳进博士复试 7143582
- 10 中美各取消91%关税 暂停24%关税 7042196