faceCapture
faceCapture copied to clipboard
没法得到landmark
我可以得到人脸框,但是没法得到landmark,我猜可能是shape_predictor_68_face_landmarks.dat的路径问题, compileSdkVersion 25 buildToolsVersion '28.0.3' defaultConfig { applicationId "signalprocess.facecapture" minSdkVersion 21 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { cppFlags "" } } ndk { moduleName "native-lib" abiFilters "x86", "x86_64", "armeabi-v7a", "arm64-v8a" }
这是我的build.gradle,我不知道该怎么解决,方便的话还请您能指点一下
然后我在 Constants类打了个log public static String getFaceShapeModelPath() { File sdcard = Environment.getExternalStorageDirectory(); String targetPath = sdcard.getAbsolutePath() + File.separator + "shape_predictor_68_face_landmarks.dat";
Log.d(TAG, targetPath);
return targetPath;
}
运行的时候输出的路径是 D/Constants: /storage/emulated/0/shape_predictor_68_face_landmarks.dat 然后我将文件shape_predictor_68_face_landmarks.dat放在这个路径下,还是不起作用
可以尝试把dat扔进assets里面,然后使用文件调取类判断是否存在文件,然后复制过去