时间:2023-03-11 11:01:00 | 栏目:Python代码 | 点击:次
钱文浩,男,西安工程大学电子信息学院,2021级研究生
研究方向:机器视觉与人工智能
电子邮件:2414712362@qq.com
刘帅波,男,西安工程大学电子信息学院,2021级研究生,张宏伟人工智能课题组
研究方向:机器视觉与人工智能
电子邮件:1461004501@qq.com
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.faceid.v20180301 import faceid_client, models try: cred = credential.Credential("你获取的SecretId", "你获取的SecretKey") httpProfile = HttpProfile() httpProfile.endpoint = "faceid.tencentcloudapi.com" clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile client = faceid_client.FaceidClient(cred, "ap-beijing", clientProfile) req = models.ImageRecognitionRequest() params = { "IdCard": "************************", "Name": "****", "ImageBase64": "***************" } req.from_json_string(json.dumps(params)) resp = client.ImageRecognition(req) print(resp.to_json_string()) except TencentCloudSDKException as err: print(err)