Read the Face SDK documentation for AI agents. Entry point: C:\3divi\3_31_0\face_sdk_ai_agent_docs\AI_KNOWLEDGE_ROOT.md. Do not explore any other content in C:\3divi.
Write a console Java application that takes two images as input; runs quality control and a liveness check on each image; matches the two images 1:1; prints quality, liveness and matching results to the console.
private static final String TEMPLATE_MODIFICATION = "1000";
static ProcessingBlock createBlock(FacerecService service, String unitType, String modification) {
Context config = service.createContext();
config.get("unit_type").setString(unitType);
if (modification != null && !modification.isEmpty()) {
config.get("modification").setString(modification);
}
return service.createProcessingBlock(config);
}
detector = createBlock(service, "FACE_DETECTOR", "ssyv_light");
fitter = createBlock(service, "FACE_FITTER", "fda");
liveness = createBlock(service, "LIVENESS_ESTIMATOR", "2d_ensemble");
extractor = createBlock(service, "FACE_TEMPLATE_EXTRACTOR", TEMPLATE_MODIFICATION);
verifier = createBlock(service, "VERIFICATION_MODULE", TEMPLATE_MODIFICATION);double score = verData.get("result").get("score").getDouble();
// ...
System.out.printf("Verdict: %s%n", score >= 0.85 ? "MATCH" : "NO MATCH");int count = (int) ioData.get("objects").size();
if (count == 0) {
return ioData;
}
fitter.process(ioData);
qualityControl.process(ioData);
if (count == 1) {
liveness.process(ioData);
}