当前位置:网站首页>腾讯云接口进行人脸检测 和签名出错问题
腾讯云接口进行人脸检测 和签名出错问题
2022-04-23 01:39:00 【Z_Gleng】
首先你需要购买人脸检测的API
我用的是人脸检测 如果买人脸对比或人脸识别他们的用法基本一致就是传参不太一样
非常简单
先说说容易踩的坑
我一开始看他的文档 我就去用postman去检测这个接口 按照以下需要必填的参数进行了传参
然后就各种报错
特别是在添加人员的时候 他说签名一直出错
The provided credentials could not be validated. Please check your signature
用它这个生成签名也不管用
最后发现出发点有问题 然后我点开点击调试去看了看
发现这里的代码生成拿去直接可以调用 到这里就是重点了 我用的是Python
把这些代码复制之后导入的包会报错 因为我用的是python 所以我们需要下载腾讯云SDK使用python版
pip install --upgrade tencentcloud-sdk-python
到这里差不多就结束了
你会发现用人家的接口只需要复制粘贴就好了
比如我们要添加人员 我们只需要填写参数即可
import json
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.iai.v20200303 import iai_client, models
try:
cred = credential.Credential("AKIDPedLnysVrwlJbcNr40g4B1atvf8KFsFL", "yf5E6h26tQgeNoyrTpuiFWWEfqkMhkX3")
httpProfile = HttpProfile()
httpProfile.endpoint = "iai.tencentcloudapi.com"
clientProfile = ClientProfile()
clientProfile.httpProfile = httpProfile
client = iai_client.IaiClient(cred, "ap-beijing", clientProfile)
req = models.CreatePersonRequest()
params = {
"GroupId": "填写你的仓库名",
"PersonName": "要录入人员的name",
"PersonId": "人员的id",
"Image":"图片bease64格式 "
}
req.from_json_string(json.dumps(params))
resp = client.CreatePerson(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
你可以根据你的业务需求把这些对应的代码放到你的代码里就行了
到这里就结束了希望大家少踩坑
版权声明
本文为[Z_Gleng]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Z_Gleng/article/details/124330905
边栏推荐
- Summary of LSF usage
- iTextSharp 基础结构
- Technology cloud report: cloud computing has entered the "second half". Where is the way out for domestic cloud?
- 四级城市地区表 xlsx, sql文件,国内,中国省市县街道乡镇四级地址 (名称,联动ID,层级,是否末级(1-是))
- In the context of Internet plus, how can enterprises innovate customer service?
- 01 knapsack problem - and deformation problem
- Practice and exploration of knowledge map visualization technology in meituan
- gin -get请求的小示例2-Handle处理post请求
- Itextsharp page setup
- engine.POST()处理POST请求
猜你喜欢
[registration] tf54: engineer growth map and excellent R & D organization building
代码实现发邮件---sendemails
Activity preview | on April 23, a number of wonderful openmldb sharing came, which lived up to the good time of the weekend!
Innovative practice of short video content understanding and generation technology in meituan
Prince saves Princess (DFS)
Oracle database query lock table SQL script and delete lock information script (necessary for database development ETL and DBA)
第六章 使用 matplotlib 绘制热力图
四级城市地区表 xlsx, sql文件,国内,中国省市县街道乡镇四级地址 (名称,联动ID,层级,是否末级(1-是))
领导/老师让填写电子excel表格文档可手机上如何编辑word/excel文件填写excel/word电子文档?
Counting garlic customers: Sudoku (DFS)
随机推荐
gin--hello
"Self abuse artifact" exploded overnight: control your face with a handle, take your own code, and bear the consequences
Counting garlic customers: Sudoku (DFS)
In the second half of the smart watch, opportunities and challenges coexist
Jerry's CPU performance test [chapter]
计蒜客:等边三角形(DFS)
Soatest preliminary understanding
Introduction to gbase8s SQL Engine framework
计蒜客(踏青)(染色块问题的DFS和BFS解法)
Self taught programming, don't read theory books foolishly, programmer: it's all left over by others
DO447管理用户和团队的访问
NR polar code VII - SCL (successful cancellation list coding)
The most easy to understand service container and scope of dependency injection
Introduction and management of gbase 8s database log
Full Permutation (DFS and next_permutation solution)
Jerry's AI server [chapter]
GBase8s SQL 引擎框架简介
科技云报道:云计算进入“下半场”,国产云的出路在哪儿?
计蒜客家谱(dfs求直系后代数)
安装mysql出问题求解决