Use an image classification model by Lobe in Power Apps

In this article, you'll learn about using an image classification model by Lobe in Power Apps.

Create a canvas app

Create a new canvas app for your image classification model. (If your model is already in a canvas app, skip this section and go to Add the Power Fx Prediction formula later in this topic.)

  1. Sign in to Power Apps.

  2. Select Create > Canvas app from blank.

    Screenshot of create a canvas app from blank.

  3. In the App name field, enter a name and select Create.

  4. If you see the Welcome to Power Apps Studio screen, select Skip.

  5. Select Data > Add data > AI models.

  6. On the dropdown, select the image classification model you want to add.

    Animation of adding an AI model as a data source.

Add the Power Fx Prediction formula

  1. On the image classification model, select the control area next to Prediction.

  2. On the formula bar, type 'Model Name'.Predict(Image).Prediction.

    In the following example of car damage, you would type this:

    'Car Damage Classifier'.Predict(AddMediaButton.Media).Prediction

    Animation of adding a Power Fx formula.

    The last property in the formula, .Prediction, will return the predicted label for the image from the model. If you want a list of all the possible labels and their corresponding confidence values from the model, use the .Labels property in the following example:

    'Model Name'.Predict(Image).Labels

Use a canvas app with a classification model

The following animation shows how users of your new app can add their own images in Power Apps and have the appropriate label automatically predicted. For example, if the user is an insurance claim adjuster, they can upload an image of a broken window in a car. The app will then predict and assign the Broken Glass label to it. The user might also want to enter more detail on a claim, such as Window broken on the driver's side.

Animation of adding an image and description.