- Download and Open Project
- Setting Up SDK License Key
Android-FaceRecognition-FaceLivenessDetection/app/src/main/assets/license
BsTr9o4f4R/rM3TxbCWVb/hrOJuOIdz8ArQ/t2IgQFFUQzGHOLNNaMJiK/fUfr5zo005zoTA/cm6
VoZ6iGl+/hZGA3R5T/VWwhxekbw8JVz9sNesU6rMG5+1cNSN75trH2tpzdCPZ28ZDnZlttmiuUoC
9QazRe1xKi5tUXa+xgIxzL0vE6UW2dLKWaEXjn3fSJfLxXWw0q+UZP0hQAXb5Y9Yl/NVi7y3d0xT
Vq6/weuMQkgLcNdLqFRvQXup0M9W/pvuhaubySAxHCKVY8wToygN2iM78cOkyyAbGVwZeGQP0Jfd
46VZo+w+KCNw355j3osVVMghrOcVZnfbp1dNyg==
import com.bio.facesdk.FaceBox
import com.bio.facesdk.FaceDetectionParam
import com.bio.facesdk.FaceSDK
var ret = FaceSDK.setActivation(license_str)
if (ret == FaceSDK.SDK_SUCCESS) {
ret = FaceSDK.init(assets)
}
override fun process(frame: Frame) {
val bitmap = FaceSDK.yuv2Bitmap(frame.image, frame.size.width, frame.size.height, cameraOrientation)
...
val faceDetectionParam = FaceDetectionParam()
faceDetectionParam.check_liveness = true
faceDetectionParam.check_liveness_level = SettingsActivity.getLivenessModelType(this)
var faceBoxes: List<FaceBox>? = FaceSDK.faceDetection(bitmap, faceDetectionParam)
val faceBox = faceBoxes[0]
val templates = FaceSDK.templateExtraction(bitmap, faceBox)
val similarity = FaceSDK.similarityCalculation(templates, person.templates)