Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Customize Your App With MLKit

Customize Your App With MLKit

The best app is one that's customized for your user, and machine learning is one of the best ways to accomplish this. Machine learning can seem like a daunting topic, but Google's MLKit makes it easy. In this talk, we'll go over how you can make use of this tool in your own mobile applications, with special attention to the new Smart Reply and Language Detection. We'll also cover how you can easily create your very own custom models with Auto ML Vision Edge. You'll leave with an understanding of the tools needed to use machine learning in your apps.

Victoria Gonda

November 02, 2019
Tweet

More Decks by Victoria Gonda

Other Decks in Programming

Transcript

  1. Hello! I'm Victoria Gonda I'm an Android Engineer at Buffer

    and author on RayWenderlich.com You can find me on Twitter at @TTGonda
  2. Barcode scanning Face detection Image labeling Landmark detection Object detection

    and tracking Text recognition Custom Language ID On device translation Smart reply
  3. Object Detection and Tracking ◍ "Localize and track in real

    time the most prominent object in the live camera feed."
  4. // Swift for iOS let options = VisionObjectDetectorOptions() options.detectorMode =

    .singleImage options.shouldEnableMultipleObjects = true options.shouldEnableClassification = true
  5. objectDetector.process(image) { detectedObjects, error in guard error == nil else

    { // Error. return } guard let detectedObjects = detectedObjects, !detectedObjects.isEmpty else { // No objects detected. return } // Success. }
  6. conversation.add(FirebaseTextMessage.createForRemoteUser( "It was great meeting you at Øredev!", System.currentTimeMillis(), userId))

    conversation.add(FirebaseTextMessage.createForRemoteUser( "Want to keep in touch?", System.currentTimeMillis(), userId))
  7. smartReply.suggestReplies(conversation) .addOnSuccessListener { result -> if (result.status == STATUS_NOT_SUPPORTED_LANGUAGE) {

    // The conversation's language isn't supported } else if (result.status == STATUS_SUCCESS) { // Show suggestions } } .addOnFailureListener { // Handle error }
  8. smartReply.suggestReplies(conversation) .addOnSuccessListener { result -> if (result.status == STATUS_NOT_SUPPORTED_LANGUAGE) {

    // The conversation's language isn't supported } else if (result.status == STATUS_SUCCESS) { // Show suggestions } } .addOnFailureListener { // Handle error }
  9. smartReply.suggestReplies(conversation) .addOnSuccessListener { result -> if (result.status == STATUS_NOT_SUPPORTED_LANGUAGE) {

    // The conversation's language isn't supported } else if (result.status == STATUS_SUCCESS) { // Show suggestions } } .addOnFailureListener { // Handle error }
  10. smartReply.suggestReplies(conversation) .addOnSuccessListener { result -> if (result.status == STATUS_NOT_SUPPORTED_LANGUAGE) {

    // The conversation's language isn't supported } else if (result.status == STATUS_SUCCESS) { // Show suggestions } } .addOnFailureListener { // Handle error }
  11. AutoML Vision Edge ◍ "Generate custom image classification models to

    use on device from your own library of images."
  12. for (label in labels) { val text = label.text val

    confidence = label.confidence }
  13. Zyl