优化
This commit is contained in:
@@ -652,9 +652,16 @@ public class FaceHelper implements FaceListener {
|
||||
});
|
||||
}
|
||||
|
||||
private int failCount = 0;
|
||||
private void searchFace(final FaceFeature faceFeature, final Integer trackId) {
|
||||
CompareResult compareResult = FaceServer.getInstance().searchFaceFeature(faceFeature, frEngine);
|
||||
if (compareResult == null || compareResult.getFaceEntity() == null) {
|
||||
failCount++;
|
||||
Log.d(TAG, "collectFace,searchFace查询失败"+failCount+"次");
|
||||
if (failCount >= 2) {
|
||||
recognizeCallback.onRecognized(null, LivenessInfo.UNKNOWN, false);
|
||||
return;
|
||||
}
|
||||
retryRecognizeDelayed(trackId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ public class RecognizeViewModel extends ViewModel implements RecognizeCallback {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// recognizeUserId.postValue(new CompareResult(null, 0f));
|
||||
recognizeUserId.postValue(new CompareResult(null, -1f));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user