百度AI 实现人体姿态检测

最近在搞人脸识别,Yolo,Dlib,单纯向量法都玩了一遍,效果还可以。
昨天由老师给我发了一个百度AI的链接,我就玩开了上面的一个demo,叫做人体姿态检测出,这个名词名副其实,其背后的数学原理和论文都相当的给力,不得不佩服那些人工智能算法科学家,这也激发着我对AI的探索和学习的乐趣!

主函数,
功能:1.主要是针对百度AI接口
---------2.利用 from aip import AipBodyAnalysis #人体分析模块

# ━━━━━神兽出没━━━━━━
#    ┏┓   ┏┓
#   ┏┛┻━━━┛┻┓
#   ┃       ┃
#   ┃   ━   ┃
#   ┃ ┳┛ ┗┳ ┃
#   ┃       ┃
#   ┃   ┻   ┃
#   ┃       ┃
#   ┗━┓   ┏━┛Code is far away from bug with the animal protecting
#     ┃   ┃    神兽保佑,代码无bug
#     ┃   ┃
#     ┃   ┗━━━┓
#     ┃       ┣┓
#     ┃       ┏┛
#     ┗┓┓┏━┳┓┏┛
#      ┃┫┫ ┃┫┫
#      ┗┻┛ ┗┻┛
#
# ━━━━━━感觉萌萌哒━━━━━━
'''人体关键点识别(14个)'''
# 与human_detection 功能相同
import configparser # 配置文件模块 读写配置文件

from aip import AipBodyAnalysis #人体分析模块
import joint
import cv2
import os

然后就是一个类 class BaiDuAPI(object):

class BaiDuAPI(object):
    #特殊 构造函数 初始化函数
    def __init__(self,filePath):
        target = configparser.ConfigParser()
        target.read(filePath,encoding='utf-8-sig')
        app_id = target.get('工单密码','APP_ID')
        api_key = target.get('工单密码', 'API_KEY')
        secret_key = target.get('工单密码', 'SECRET_KEY')

        self.client = AipBodyAnalysis(app_id, api_key, secret_key)
     
    """ 读取图片 """
    def get_file_content(self,photoPath):
        with open(photoPath, 'rb') as fp:
            return fp.read()

    """ 主函数 """    
    def file_main(self,photoPath):   
        img = self.get_file_
  • 11
    点赞
  • 72
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 27
    评论
评论 27
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

暗香独自开

你的鼓励是我总结的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值