Android face detection development-use GMV API (google mobile vision library) to develop face detection functions

It is better to teach people how to fish than to teach people how to fish: it is recommended to read the following official website information!

 

Precautions:

1. The problem of failed download of face detection library

When installing the face detection APP for the first time, download the corresponding library from Google’s official website. As Google cannot be accessed in China,

Therefore, the library cannot be downloaded and the face cannot be detected.

Several methods can be tried:

  1. Over the wall, it has not yet worked.
  2. Do I need to install google play service on my phone? To be determined

The first time that an app using the Face API is installed on a device, GMS will download a native library to the device in order to do face detection.

Usually this is done by the installer before the app is run for the first time.

But if that download has not yet completed, then the above “detect” method will not detect any faces.

There are several reasons why the face detection library cannot be downloaded: unable to connect to Google, or the phone's memory space is insufficient.

This could happen if the user is not online, if the user lacks sufficient storage space on their device, or if the download is otherwise delayed (e.g., due to a slow network).

The detector will automatically become operational once the library download has been completed on device.

A detector’s isOperational method can be used to check if the required native library is currently available:

Use the isOperational attribute to determine whether the face detection library is downloaded successfully, sample code:

2. The problem of library suspension maintenance and transfer to ML

As an independent library, GMV has ceased maintenance and has been added to Firebase's ML machine learning library.

The Mobile Vision API is now a part of ML Kit. We strongly encourage you to try it out, as it comes with new capabilities like on-device image labeling! Also, note that we ultimately plan to wind down the Mobile Vision API, with all new on-device ML capabilities released via ML Kit. Feel free to reach out to Firebase support for help.

 

Guess you like

Origin blog.csdn.net/qq_18276949/article/details/106229221