Skip to content

Instantly share code, notes, and snippets.

@aligkts
Created June 16, 2019 11:32
Show Gist options
  • Save aligkts/8b35d857b5f5d3b30f75c74e6a9cfd4e to your computer and use it in GitHub Desktop.
Save aligkts/8b35d857b5f5d3b30f75c74e6a9cfd4e to your computer and use it in GitHub Desktop.
private fun runDetector(bitmap: Bitmap) {
val image = FirebaseVisionImage.fromBitmap(bitmap)
val options = FirebaseVisionFaceDetectorOptions.Builder()
.build()
val detector = FirebaseVision.getInstance()
.getVisionFaceDetector(options)
detector.detectInImage(image)
.addOnSuccessListener { faces ->
processFaceResult(faces)
}.addOnFailureListener {
it.printStackTrace()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment