FirebaseVisionFaceDetector

public class FirebaseVisionFaceDetector extends Object
implements Closeable Closeable

Detector for finding FirebaseVisionFaces in a supplied image.

A face detector is created via getVisionFaceDetector(FirebaseVisionFaceDetectorOptions) or getVisionFaceDetector(), if you wish to use the default options. For example, the code below creates a face detector with default options.

 FirebaseVisionFaceDetector faceDetector =
    FirebaseVision.getInstance().getVisionFaceDetector();
 
To perform face detection in an image, you first need to create an instance of FirebaseVisionImage from a Bitmap, ByteBuffer, etc. See FirebaseVisionImage documentation for more details. For example, the code below creates a FirebaseVisionImage from a Bitmap.
      FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);
Then the code below can detect faces in the supplied FirebaseVisionImage.

 Task<List<FirebaseVisionFace>> task = faceDetector.detectInImage(image);
 task.addOnSuccessListener(...).addOnFailureListener(...);
 

Public Method Summary

void
close()
Closes this FirebaseVisionFaceDetector and releases its model resources.
Task<List<FirebaseVisionFace>>
detectInImage(FirebaseVisionImage image)
Detects human faces from the supplied image.

Inherited Method Summary

Public Methods

public void close ()

Closes this FirebaseVisionFaceDetector and releases its model resources.

Throws
IOException

public Task<List<FirebaseVisionFace>> detectInImage (FirebaseVisionImage image)

Detects human faces from the supplied image.

For best efficiency, create a FirebaseVisionImage object using one of the following ways:

All other FirebaseVisionImage factory methods will work as well, but possibly slightly slower.
Returns

Send feedback about...

Need help? Visit our support page.
{"cc_re__cc_re__cc_by_3_0": ["ml/vision/face/FirebaseVisionFace.html\">FirebaseVisionFace</a></code>s.</li>\n            </ul>\n          </div>\n        </div>\n      </div>\n    </section><!-- ========= METHOD DETAIL ======== -->\n    <!-- ========= END OF CLASS DATA ========= -->\n    <a name=\"navbar_top\" id=\"navbar_top\"></a>\n  </div><!-- jd-content -->\n\n  </div>\n  \n\n  \n        \n  \n\n\n\n\n\n\n\n        \n<div class=\"devsite-content-footer nocontent\">\n  \n  \n    <p>Except as otherwise noted, the content of this page is licensed under the <a href=\"https://creativecommons.org/licenses/by/3.0/\">Creative Commons Attribution 3.0 License</a>, and code samples are licensed under the <a href=\"https://www.apache.org/licenses/LICENSE-2.0\">Apache 2.0 License</a>. For details, see our <a href=\"https://developers.google.com/terms/site-policies\">Site Policies</a>. Java is a registered trademark of Oracle and/or its affiliates.</p>\n  \n\n  \n    \n    <p class=\"devsite-content-footer-date\" itemprop=\"datePublished\"\n       content=\"2018-05-08T18:30:24.682920\">\n      \n      Last updated May 8, 2018.\n    "]}