ML.NET version | API type | Status | App Type | Data type | Scenario | ML Task | Algorithms |
---|---|---|---|---|---|---|---|
v1.4 | Dynamic API | up-to-date | Console app | Images and text labels | Images classification | TensorFlow model | DeepLearning model |
The problem is how to run/score a TensorFlow model in a web app/service while using in-memory images.
The model (model.pb
) is trained using TensorFlow as disscussed in the blogpost Run with ML.NET C# code a TensorFlow model exported from Azure Cognitive Services Custom Vision.
See the below architecture that shows how to run/score TensorFlow model in ASP.NET Core Razor web app/service:
The difference between the getting started sample and this end-to-end sample is that the images are loaded from file in getting started sample whereas the images are loaded from in-memory in this end-to-end sample.
Note: this sample is trained using Custom images and it predicts the only specific images that are in TestImages Folder.
If you are using a custom trained TensorFlow model and getting low scores, you may need to resize your input images and fine-tune some of the values in the ImageSettings struct, such as the image size (imageHeight and imageWidth) and offset (mean). As you adjust these values, take note of how they affect scoring.
You can review the Run with ML.NET C# code a TensorFlow model exported from Azure Cognitive Services Custom Vision blogpost if you have any questions about meeting the needs of your model to get accurate predictions.