to tflite model) .build() val options = CustomImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.5f) .setMaxResultCount(5) .build() val labeler = ImageLabeling.getClient(options)
for (label in detectedObject.labels) { val name = label.text val confidence: Int = label.confidence.times(100).toInt() when (label.index) { PredefinedCategory.HOME_GOOD_INDEX -> { ... } } ... } } } ...
Model downloaded successfully. Okay to start translating. } .addOnFailureListener { exception -> // Model couldn’t be downloaded or other internal error. }
Android」 • https://codelabs.developers.google.com/codelabs/mlkit-android • 「Recognize, Identify Language and Translate text with ML Kit and CameraX: Android」 • https://codelabs.developers.google.com/codelabs/mlkit-android- translate