MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.25k stars 21.42k forks source link

Prediction using image or web URL #31090

Closed thecpshah closed 5 years ago

thecpshah commented 5 years ago

Hello,

Once the model is built, what is the best option to make predictions? Is it to use web URL or Image Path?

For example, how do I pass images stored in Azure Blob Storage to the prediction API?

Many thanks, Chintan


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

RohitMungi-MSFT commented 5 years ago

@thecpshah Thanks for the feedback. We are investigating into the issue and will update you shortly.

RohitMungi-MSFT commented 5 years ago

@thecpshah The option to use the image URL or image path depends on the client application that is designed to use the custom vision service. For example, If your images are stored in azure storage account you can use SAS to authenticate from the application and use the prediction API for image to send the image file in the body. If URL is used you can set the SAS parameters for URI access and pass the same the URI in the body of the request to prediction API.

I would also suggest to raise a user voice request to our product group based on your requirement so they can check if a solution to integrate blob storage with custom vision prediction is possible. Here is one such request for using blob storage for training images of custom vision.

thecpshah commented 5 years ago

Thank you @RohitMungi-MSFT for looking into this. The idea is to periodically send images stored in Azure storage to prediction API and get results.

Once more question: does the API take images in batch mode or a single image at a time?

RohitMungi-MSFT commented 5 years ago

@thecpshah Yes, you can use batch prediction. Please take a look at this github repo for custom vision client library and sample for windows. You can use BatchPredictorWithRateLimit for batch predictions.

thecpshah commented 5 years ago

Thanks @RohitMungi-MSFT for your quick response. I have also raised a user voice request.

thecpshah commented 5 years ago

@RohitMungi-MSFT Do you have example codes using Python? For batch processing and SAS authentication?

RohitMungi-MSFT commented 5 years ago

Here is the sample code for SAS authentication for python. The batch prediction for python SDK client is currently not available.

thecpshah commented 5 years ago

Thank you @RohitMungi-MSFT . closing this now.

thecpshah commented 5 years ago

Hi @RohitMungi-MSFT a question on Prediction API: how is it deployed? Is it an instance of ACI or AKS? do I need to export the model and redeploy it using ACI or AKS?

RohitMungi-MSFT commented 5 years ago

Once you publish your iteration the prediction API details are available. Currently the platform on which it is deployed is not made public as users only have access to the API. You can only export models which use compact domain as docker files and run them using ACI or AKS if required.

RohitMungi-MSFT commented 5 years ago

@thecpshah We will now proceed to close this thread. If there are further questions regarding this matter, please tag @RohitMungi-MSFT in your reply. We will gladly continue the discussion and we will reopen the issue.

thecpshah commented 5 years ago

Thank you @RohitMungi-MSFT . Does that mean that we can use the API from published iteration in production system?

RohitMungi-MSFT commented 5 years ago

@thecpshah Yes, You can use the published iteration for production. We can basically publish only one iteration at any point of time. If there is an issue with an iteration you can unpublish it and publish a new iteration.

thecpshah commented 5 years ago

Great! thank you @RohitMungi-MSFT

thecpshah commented 5 years ago

At present, in CustomVision.AI UI, we can upload images from local machine for training. However, in order to train the model, how do we pass the images stored in Azure Blob Storage?