Aliyun_人脸人体_手势关键点检测

本文深入探讨了阿里云的人脸、人体关键点检测技术,并详细阐述了其在手势识别中的应用,揭示了如何利用Python进行相关算法的实现和实战操作。
摘要由CSDN通过智能技术生成
import oss2
import json
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
AccessKeyId="xxxxx"
AccessKeySecret="xxxxxx"
auth = oss2.Auth(AccessKeyId, AccessKeySecret)
bucket = oss2.Bucket(auth, 'https://oss-cn-shanghai.aliyuncs.com', 'ocr-yjs')
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkcore.auth.credentials import AccessKeyCredential
from aliyunsdkcore.auth.credentials import StsTokenCredential
credentials = AccessKeyCredential(AccessKeyId, AccessKeySecret)
client = AcsClient(region_id='cn-shanghai', credential=credentials)
import seaborn as sns
"""

https://help.aliyun.com/document_detail/159214.html
手势关键点检测
HandPosture可以获取手势的二十一个关键点信息。
"""

from aliyunsdkfacebody.request.v20191230.HandPostureRequest import HandPostureRequest

request = HandPostureRequest()
request.set_accept_format('json')

filepath="images/手掌.jpg"
with open(filepath, 'rb') as fileobj:
    bucket.put_object(filepath, fileobj)
url="https://ocr-yjs.oss-cn-shanghai.aliyuncs.com/"+filepath
request.set_ImageURL(url)

response = client.do_action_with_exception(request)
response=json.loads(str(response, encoding='utf-8'))
print(response)
{'RequestId': '78DC25B8-4675-58C5-B2CD-2B4063BE1BF1', 'Data': {'MetaObject': {'Height': 478, 'Width': 850}, 'Outputs': [{'Results': [{'Hands': {'Confident': 1, 'KeyPoints': [{'Label': '0', 'Positions': [{'Points': [0.4750716984272003, 0.7935550808906555]}]}, {'Label': '1', 'Positions': [{'Points': [0.41993096470832825, 0.712688148021698]}]}, {'Label': '2', 'Positions': [{'Points': [0.3470659554004669, 0.601658284664154]}]}, {'Label': '3', 'Positions': [{'Points': [0.30989059805870056, 0.46409955620765686]}]}, {'Label': '4', 'Positions': [{'Points': [0.27792635560035706, 0.364242821931839]}]}, {'Label': '5', 'Positions': [{'Points': [0.42169979214668274, 0.45184677839279175]}]}, {'Label': '6', 'Positions': [{'Points': [0.4230223298072815, 0.28472110629081726]}]}, {'Label': '7', 'Positions': [{'Points': [0.4261426627635956, 0.17738473415374756]}]}, {'Label': '8', 'Positions': [{'Points': [0.43028169870376587, 0.07360294461250305]}]}, {'Label': '9', 'Positions': [{'Points': [0.4758013188838959, 0.4497516453266144]}]}, {'Label': '10', 'Positions': 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值