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.

Features

This project framework provides the following features:

  • Detects faces in an image.
  • Draws a rectangle around each face.

Android screenshot of a photo with faces framed by a red rectangle

Getting Started

Prerequisites

Quickstart

  1. Clone or download the repository.
  2. Open Android Studio and select Open an existing Android Studio project.
  3. Navigate to the FaceTutorial folder and click OK.
  4. In the Project pane, expand app > java > com.contoso.facetutorial, then open MainActivity.
  5. Replace <API endpoint> with the Azure region associated with your subscription key.
  6. Replace <Subscription Key> with your subscription key.
  7. Run the app.
  8. Browse and select an image containing faces.
  9. 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.

Resources