Skip to content

Instantly share code, notes, and snippets.

@Rishit-dagli
Created December 11, 2020 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rishit-dagli/4da4b360ec40a7d3193812506c25778e to your computer and use it in GitHub Desktop.
Save Rishit-dagli/4da4b360ec40a7d3193812506c25778e to your computer and use it in GitHub Desktop.
An example showing inference with MLKit in Android
private val objectDetector = ObjectDetection.getClient(customObjectDetectorOptions) objectDetector.process(image)
.addOnFailureListener(Log.d(...))
.addOnSuccessListener{
graphicsOverlay.clear()
for (detectedObject in it){
graphicsOverlay.add(ObjectGraphic(graphicsOverlay, detectedObject))
}
graphicsOverlay.postInvalidate()}
.addOnCompleteListenerl imageProxy.close() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment