Skip to content

Latest commit

 

History

History
 
 

face_detection

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

status: inactive

The Google Cloud Vision API Java samples have moved. This directory is no longer actively developed or maintained.

For new work on this check out the face detection vision sample in the Google Cloud Platform Java samples repository.

Google Cloud Vision API Java Face Detection example

Download Maven

This sample uses the Apache Maven build system. Before getting started, be sure to download and install it. When you use Maven as described here, it will automatically download the needed client libraries.

Setup

  • Create a project with the Google Cloud Console, and enable the Vision API.

  • Set up your environment with Application Default Credentials. For example, from the Cloud Console, you might create a service account, download its json credentials file, then set the appropriate environment variable:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json

Run the sample

To build and run the sample, run the following from this directory:

mvn clean compile assembly:single
java -cp target/face-detection-1.0-SNAPSHOT-jar-with-dependencies.jar com.google.cloud.vision.samples.facedetect.FaceDetectApp ../../data/face_detection/face.jpg output.jpg

For more information about face detection see the Quickstart guide.