Detect and frame faces in an image on Android
This repository contains the sample discussed in Create an Android app to detect and frame faces in an image. The sample uses the Java client library for the Cognitive Services Face service.
This project framework provides the following features:
- Detects faces in an image.
- Draws a rectangle around each face.
- You need a subscription key to run the sample. You can get free trial subscription keys from Try Cognitive Services.
- Android Studio with minimum SDK 22 (required by the Face client library).
- The com.microsoft.projectoxford : face : 1.4.3 Java client library from Maven. It isn't necessary to download the package.
- Clone or download the repository.
- Open Android Studio and select Open an existing Android Studio project.
- Navigate to the FaceTutorial folder and click OK.
- In the Project pane, expand app > java > com.contoso.facetutorial, then open
<API endpoint>with the Azure region associated with your subscription key.
<Subscription Key>with your subscription key.
- Run the app.
- Browse and select an image containing faces.
- Wait a few seconds for the Face service to respond.
For more information, see Create an Android app to detect and frame faces in an image.