| | |
| | | httpProfile.Endpoint = ("ocr.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | |
| | | var _ocrClient = new OcrClient(cred, "ap-chengdu", clientProfile); |
| | | var _ocrClient = new OcrClient(cred, "ap-shanghai", clientProfile); |
| | | |
| | | IDCardOCRRequest req = new IDCardOCRRequest(); |
| | | if (isFRONT) |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public BizLicenseOCRResponse BizLicenseOCR(string ImageBase64) |
| | | { |
| | | try |
| | | { |
| | | |
| | | Credential cred = new Credential |
| | | { |
| | | SecretId = App.Configuration["TencentCloud:SecretId"] ?? "AKIDIPFp9CyThfMmvoQlpeCl34pKYVBahY9T", |
| | | SecretKey = App.Configuration["TencentCloud:SecretKey"] ?? "4rNcaHhrkMhmb9QQ9bmgKipfFZcOt86n" |
| | | }; |
| | | |
| | | ClientProfile clientProfile = new ClientProfile(); |
| | | HttpProfile httpProfile = new HttpProfile(); |
| | | |
| | | |
| | | httpProfile.Endpoint = ("ocr.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | |
| | | var _ocrClient = new OcrClient(cred, "ap-shanghai", clientProfile); |
| | | |
| | | var ret = _ocrClient.BizLicenseOCRSync(new BizLicenseOCRRequest() |
| | | { |
| | | ImageBase64 = ImageBase64, |
| | | }); |
| | | |
| | | return ret; |
| | | } |
| | | catch (Exception) |
| | | { |
| | | throw; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region iai 人脸识别 |
| | |
| | | httpProfile.Endpoint = ("iai.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | |
| | | var iaiClient = new IaiClient(cred, "ap-chengdu", clientProfile); |
| | | var iaiClient = new IaiClient(cred, "ap-shanghai", clientProfile); |
| | | try |
| | | { |
| | | var retinfo = iaiClient.GetGroupInfoSync(new GetGroupInfoRequest |
| | |
| | | httpProfile.Endpoint = ("iai.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | |
| | | var iaiClient = new IaiClient(cred, "ap-chengdu", clientProfile); |
| | | var iaiClient = new IaiClient(cred, "ap-shanghai", clientProfile); |
| | | var ret= iaiClient.CreatePerson(new TencentCloud.Iai.V20200303.Models.CreatePersonRequest |
| | | { |
| | | GroupId = App.Configuration["IAIGroupSet:ID"], |
| | |
| | | |
| | | httpProfile.Endpoint = ("iai.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | var iaiClient = new IaiClient(cred, "ap-chengdu", clientProfile); |
| | | var iaiClient = new IaiClient(cred, "ap-shanghai", clientProfile); |
| | | var ret = iaiClient.CreateFace( new TencentCloud.Iai.V20200303.Models.CreateFaceRequest |
| | | { |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public VerifyFaceResponse VerifyFace(string img64, string PersonNameId) |
| | | { |
| | | Credential cred = new Credential |
| | | { |
| | | SecretId = App.Configuration["TencentCloud:SecretId"] ?? "AKIDIPFp9CyThfMmvoQlpeCl34pKYVBahY9T", |
| | | SecretKey = App.Configuration["TencentCloud:SecretKey"] ?? "4rNcaHhrkMhmb9QQ9bmgKipfFZcOt86n" |
| | | }; |
| | | |
| | | ClientProfile clientProfile = new ClientProfile(); |
| | | HttpProfile httpProfile = new HttpProfile(); |
| | | |
| | | |
| | | httpProfile.Endpoint = ("iai.tencentcloudapi.com"); |
| | | clientProfile.HttpProfile = httpProfile; |
| | | var iaiClient = new IaiClient(cred, "ap-shanghai", clientProfile); |
| | | var ret = iaiClient.VerifyFaceSync(new TencentCloud.Iai.V20200303.Models.VerifyFaceRequest |
| | | { |
| | | |
| | | PersonId = PersonNameId, |
| | | Image= img64 |
| | | |
| | | |
| | | |
| | | }); |
| | | return ret; |
| | | |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | } |