def DetectLiveFace(self, request): """用于对用户上传的静态图片进行人脸活体检测。与动态活体检测的区别是:静态活体检测中,用户不需要通过唇语或摇头眨眼等动作来识别。 静态活体检测适用于手机自拍的场景,或对防攻击要求不高的场景。如果对活体检测有更高安全性要求,请使用[人脸核身·云智慧眼](https://cloud.tencent.com/product/faceid)产品。 > - 图片的宽高比请接近3:4,不符合宽高比的图片返回的分值不具备参考意义。本接口适用于类手机自拍场景,非类手机自拍照返回的分值不具备参考意义。 > - 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。 :param request: Request instance for DetectLiveFace. :type request: :class:`tencentcloud.iai.v20180301.models.DetectLiveFaceRequest` :rtype: :class:`tencentcloud.iai.v20180301.models.DetectLiveFaceResponse` """ try: params = request._serialize() body = self.call("DetectLiveFace", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.DetectLiveFaceResponse() model._deserialize(response["Response"]) return model else: code = response["Response"]["Error"]["Code"] message = response["Response"]["Error"]["Message"] reqid = response["Response"]["RequestId"] raise TencentCloudSDKException(code, message, reqid) except Exception as e: if isinstance(e, TencentCloudSDKException): raise else: raise TencentCloudSDKException(e.message, e.message)
def DetectLiveFace(self, request): """用于对用户上传的静态图片进行人脸活体检测。与动态活体检测的区别是:静态活体检测中,用户不需要通过唇语或摇头眨眼等动作来识别。 静态活体检测仅用于对防攻击要求不高的场景,如果对活体检测有更高安全性要求,请使用[人脸核身·云智慧眼](https://cloud.tencent.com/product/faceid)产品。 :param request: 调用DetectLiveFace所需参数的结构体。 :type request: :class:`tencentcloud.iai.v20180301.models.DetectLiveFaceRequest` :rtype: :class:`tencentcloud.iai.v20180301.models.DetectLiveFaceResponse` """ try: params = request._serialize() body = self.call("DetectLiveFace", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.DetectLiveFaceResponse() model._deserialize(response["Response"]) return model else: code = response["Response"]["Error"]["Code"] message = response["Response"]["Error"]["Message"] reqid = response["Response"]["RequestId"] raise TencentCloudSDKException(code, message, reqid) except Exception as e: if isinstance(e, TencentCloudSDKException): raise e else: raise TencentCloudSDKException(e.message, e.message)