androidface-detectionhuawei-mobile-serviceshuawei-developershuawei-ml-kit

Huawei Face detection with ML Kit won't work on some devices


I am trying to create a simple Android app that can recognize faces from a bitmap. First, I am trying to initialize VisionBase with the following lines of code:

VisionBase.init(c, object : ConnectionCallback {
override fun onServiceConnect() {
    l.engineReady()
    Log.i("LOG_TAG", "onServiceConnect")
}

override fun onServiceDisconnect() {
    l.engineDisconnected()
    Log.i("LOG_TAG", "onServiceDisconnect")
}
})

Unfortunately, onServiceConnect and onServiceDisconect were never called. In my LogCat I can a multiple errors with the same error message:

Access denied finding property "hwservicemanager.ready"

I have to mention that I have three devices. On my Huawei p40 Lite everything works fine, but on my Huawei Y6 2018 (model ATU-L21, EMUI version 8.0.0) and Huawei Y5p (EMUI version 10.1.0.151)I can reproduce this behavior every time.


Solution

  • Face Detection uses Machine Learning to implement this feature, and has some dependencies on mobile device's chipset. The Y6 and Y5P are equiped with Mediatek MT6761 and MT6762R chip, while P40 Lite has a Kirin 810. Here is the list for supported devices,pls refer.

    It is recommended that you use the ML Kit of HMS Core as a substitute,support EMUI 5.0 or later Android devices.

    enter image description here

    For Detail,pls kindly refer this Docs.