<dependency><groupId>com.tencentcloudapi</groupId><artifactId>tencentcloud-sdk-java-intl-en</artifactId><version>3.0.798</version></dependency>
// Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parametersCredential cred = new Credential("secretId", "secretKey");// Instantiate the client object of the requested productClientProfile clientProfile = new ClientProfile();clientProfile.setSignMethod(ClientProfile.SIGN_TC3_256);FaceidClient client = new FaceidClient(cred, "ap-singapore", clientProfile);
// Step 1: Instantiate the request object and provide necessary parametersCompareFaceLivenessRequest request = new CompareFaceLivenessRequest();request.setLivenessType("SILENT");request.setImageBase64(getBase64(cmd.getOptionValue(IMAGE_PATH)));request.setVideoBase64(getBase64(cmd.getOptionValue(VIDEO_PATH)));// Step 2: Call the Tencent Cloud API through FaceIdClientCompareFaceLivenessResponse response = client.CompareFaceLiveness(request);// Step 3: Process the Tencent Cloud API response and construct the return objectSystem.out.println(CompareFaceLivenessResponse.toJsonString(response));
Feedback