当前位置:网站首页>Error in face detection and signature of Tencent cloud interface
Error in face detection and signature of Tencent cloud interface
2022-04-23 01:42:00 【Z_ Gleng】
First, you need to buy face detection API
I use face detection If you buy face comparison or face recognition, their usage is basically the same, that is, the transmission parameters are different
It's simple
Let's talk about the pit that is easy to step on
I first looked at his documents I'll use it postman To detect this interface The parameters are transferred according to the following required parameters
And then all kinds of errors

Especially when adding people He said the signature was always wrong
The provided credentials could not be validated. Please check your signature

Using it to generate a signature doesn't work
Finally, I found that there was a problem with the starting point Then I clicked on debugging to have a look

It is found that the code generation here can directly call That's the point I use it Python

After copying these codes, the imported package will report an error Because I'm using python So we need to download Tencent cloud SDK Use python edition
pip install --upgrade tencentcloud-sdk-python
It's almost over here
You will find that you only need to copy and paste the interface of others
For example, we need to add people We just need to fill in the parameters

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": " Fill in your warehouse name ",
"PersonName": " Personnel to be entered name",
"PersonId": " Personnel id",
"Image":" picture bease64 Format "
}
req.from_json_string(json.dumps(params))
resp = client.CreatePerson(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
You can put these corresponding codes into your code according to your business needs
It's over here. I hope you don't step on the pit
版权声明
本文为[Z_ Gleng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230138519890.html
边栏推荐
- New functions of ai2022, introduction to new functions of illustrator 2022
- Itextsharp displays Chinese fonts
- 计蒜客(踏青)(染色块问题的DFS和BFS解法)
- GBase 8s 备份介绍
- Jerry's AI server [chapter]
- 稳定币是让公链加速死亡或者取代BTC的超级机会?
- LSF的使用方法总结
- DFS奇偶性剪枝
- The most easy to understand service container and scope of dependency injection
- 科技云报道:云计算进入“下半场”,国产云的出路在哪儿?
猜你喜欢

计蒜客:方程的解数

Qingyan environment and Shenzhen Stock Exchange listing: annual revenue of 180 million and market value of 4.1 billion

Slow response of analysis API

W801 / w800 WiFi socket development (II) - UDP Bluetooth control WiFi connection

Detonate the bomb (DFS)

科技云报道:云计算进入“下半场”,国产云的出路在哪儿?

关于C4D动画如何导入Lumion

Level 4 city area table xlsx, SQL file, domestic, provincial, county, street, township level 4 address in China (name, linkage ID, level, end level or not (1-yes))

Introduction to PCIe xdma IP core (with list) - mingdeyang science and Education (mdy edu. Com)

第六章 使用 matplotlib 绘制热力图
随机推荐
安装mysql出问题求解决
最长公共子序列(记录路径版)
Rotation slice
Jerry's AI server [chapter]
Garlic Junkai company (DFS full arrangement)
最新流程引擎 flowable 6.7.2 更新说明
UVC camera encapsulation class
GBase 8s 备份介绍
Vscode + PHP debug + namespace guidelines
Gbase 8s group by function introduction
Soatest preliminary understanding
d盘分给C盘后,数据库恢复挂起怎么办,求各位解答
Redis实现分布式锁
Google developer tool preserve log
LSF的使用方法总结
Introduction to gbase 8s shared memory buffer pool
W801 / w800 WiFi socket development (II) - UDP Bluetooth control WiFi connection
2022 crane driver (limited to bridge crane) examination question bank and online simulation examination
.NET单元测试第一篇:常见.NET单元测试框架有哪些?
[course summary] Hello harmonyos series of courses, take you to zero foundation introduction