-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否支持对bitmap检测人脸? #20
Comments
里面有工具把bitmap转成byte[],你可以使用里面的工具 |
试过了,也是无法检测出人脸,view bitmap是正常显示的 |
工具返回图像时RGBA格式的, |
val bmp = getBitmapByPath(filePath)
if (bmp != null && !bmp.isRecycled) {
KitCore.init(context, AndroidConfig
.create()
.setNormalMode()
.setDefaultFunc()
.setInputImageFormat(AndroidConfig.ImageFormat.RGBA)
.setInputImageSize(bmp.width, bmp.height)
.setOutputImageSize(bmp.width, bmp.height))
val detect = Face.detect(bitmap2Bytes(bmp))
bmp.recycle()
} 代码如上 |
用这个转byte[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
代码如下
KitCore.init(context, AndroidConfig
.create()
.setNormalMode()
.openFunc(AndroidConfig.Func.Detect)
.openFunc(AndroidConfig.Func.Attribution)
.setInputImageFormat(AndroidConfig.ImageFormat.RGB));
val detect = Face.detect(bitmap2RGBData(bmp))
或者每次都初始化
KitCore.init(context, AndroidConfig
.create()
.setNormalMode()
.openFunc(AndroidConfig.Func.Detect)
.openFunc(AndroidConfig.Func.Attribution)
.setInputImageFormat(AndroidConfig.ImageFormat.RGB)
.setInputImageSize(bmp.width,bmp.height)
.setOutputImageSize(bmp.width,bmp.height))
val detect = Face.detect(bitmap2RGBData(bmp))
最终返回的faceCount都是0
The text was updated successfully, but these errors were encountered: