我正在创建一个人脸检测应用程序。当我尝试启动人脸检测时,出现以下错误:
E/NativeFaceDetectorImpl: Native face detection failed
E/NativeFaceDetectorImpl: java.lang.RuntimeException: Error accessing ByteBuffer.
这是我的代码的一部分:
Context context = getApplicationContext();
FaceDetector detector = new FaceDetector.Builder(context)
.setClassificationType(FaceDetector.ALL_CLASSIFICATIONS)
.setMode(FaceDetector.ACCURATE_MODE)
.build();
detector.setProcessor(
new MultiProcessor.Builder<>(new FaceTrackerFactory())
.build());
if (!detector.isOperational()) {
Log.w(TAG, "Face detector dependencies are not yet available.");
}
mCameraSource = new CameraSource.Builder(context, detector)
.setFacing(CameraSource.CAMERA_FACING_BACK)
.setRequestedFps(30.0f)
.build();
当我执行 mCameraSource.start() 时会显示错误,即使这样做时没有检测到错误并且应用程序不会崩溃,它只是在控制台上重复显示该错误。