Skip to content

Instantly share code, notes, and snippets.

@the-dagger
Last active August 1, 2018 07:05
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/917897953582d92218037adc82a03d5d to your computer and use it in GitHub Desktop.
Save the-dagger/917897953582d92218037adc82a03d5d to your computer and use it in GitHub Desktop.
override fun onCreate(savedInstanceState: Bundle?) {
//...
//Load a cloud model using the FirebaseCloudModelSource Builder class
val cloudSource = FirebaseCloudModelSource.Builder("pokedex") //name of the model created in Firebase Console
.enableModelUpdates(true)
.build()
//Registering the cloud model loaded above with the ModelManager Singleton
FirebaseModelManager.getInstance().registerCloudModelSource(cloudSource)
//Load a local model using the FirebaseLocalModelSource Builder class
val fireBaseLocalModelSource = FirebaseLocalModelSource.Builder("pokedex")
.setAssetFilePath("pokedex.tflite") //name of the .tflite model stored in asset folder
.build()
//Registering the model loaded above with the ModelManager Singleton
FirebaseModelManager.getInstance().registerLocalModelSource(fireBaseLocalModelSource)
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment