Skip to content

Instantly share code, notes, and snippets.

@the-dagger
Created August 1, 2018 07:50
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 the-dagger/74cc344448f19bf422b957928e9e8cde to your computer and use it in GitHub Desktop.
Save the-dagger/74cc344448f19bf422b957928e9e8cde to your computer and use it in GitHub Desktop.
override fun onCreate(savedInstanceState: Bundle?) {
//...
private fun getPokemonFromBitmap(bitmap: Bitmap?) {
val inputs = FirebaseModelInputs.Builder()
.add(convertBitmapToByteBuffer(bitmap)) // add() as many input arrays as your model requires
.build()
fireBaseInterpreter.run(inputs, inputOutputOptions)
?.addOnSuccessListener {
//The interpreter identified a Pokemon
}
?.addOnFailureListener {
//The interpreter failed to identify a Pokemon
}
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment