= CustomModelDownloadConditions.Builder().requireWifi().build() FirebaseModelDownloader.getInstance() .getModel("vision_classifier_food", DownloadType.LOCAL_MODEL, conditions) .addOnSuccessListener { model -> model?.file?.let { val localModel = LocalModel.Builder() .setAbsoluteFilePath(it.absolutePath) .build() val customImageLabelerOptions = CustomImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.1f) .setMaxResultCount(5) .build() labeler = ImageLabeling.getClient(customImageLabelerOptions) } } implementation("com.google.firebase:firebase-ml-modeldownloader:25.0.1")