腾讯活体人脸核身:传入视频和身份信息,先判断视频中是否为真人,判断为真人后,再判断该视频中的人与公安权威库的证件照是否属于同一个人。
安装控件:https://github.com/TencentCloud/tencentcloud-sdk-php
要是不会Composer安装的,看下面
1.打开上述网址,拉取项目
2.将src目录下的TencentCloud目录放在你的项目extend里面;
3.在你的控制器方法里面引入下面代码:
use TencentCloud\Common\Credential;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Faceid\V20180301\FaceidClient;
use TencentCloud\Faceid\V20180301\Models\LivenessRecognitionRequest;
public function aaa(){
$cred = new Credential("SecretId", "SecretKey");
$httpProfile = new HttpProfile();
$httpProfile->setEndpoint("faceid.tencentcloudapi.com");
$clientProfile = new ClientProfile();
$clientProfile->setHttpProfile($httpProfile);
$client = new FaceidClient($cred, "", $clientProfile);
$req = new LivenessRecognitionRequest();
$params = array(
"IdCard" => "身份证号",
"Name" => "姓名",
"VideoBase64" => "视频base64",
"LivenessType" => "SILENT" //活体检测类型,取值:LIP/ACTION/SILENT。 LIP为数字模式,ACTION为动作模式,SILENT为静默模式,三种模式选择一种传入。
);
$req->fromJsonString(json_encode($params));
$resp = $client->LivenessRecognition($req);
dump($resp->toJsonString());
}
以上就是腾讯云人脸核身的APP版本的接口了.如果实用的话,帮忙点个赞,谢谢了