Skip to content

Instantly share code, notes, and snippets.

@yektasarioglu
Last active November 30, 2020 11:06
Show Gist options
  • Save yektasarioglu/4ba7baa82a0354209289af183c0b0ebd to your computer and use it in GitHub Desktop.
Save yektasarioglu/4ba7baa82a0354209289af183c0b0ebd to your computer and use it in GitHub Desktop.
Start Analyzing
private fun analyze(frame: MLFrame) {
// Create a task to process the result returned by the image segmentation analyzer.
val task: Task<MLImageSegmentation> = analyzer?.asyncAnalyseFrame(frame)!!
// Asynchronously process the result returned by the image segmentation analyzer.
task.addOnSuccessListener {
// Detection success.
Log.i(TAG, "Success - Result is $it")
configureAfterImage(it.foreground)
}.addOnFailureListener {
// Detection failure.
Log.e(TAG, "Failure - Exception is $it")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment