In my previous post I wrote
- How to create a custom dataset with images to be used on a Azure Machine Learning Designer project.
- How to use the custom data set and how to train an image classification model.
- How to publish the model to be used as a WebService / HTTP REST endpoint.
Each endpoint provides a set of code samples in C#, Python and R. The code is autogenerated, and because we are working with binay images, the generated code will be huge !!! This is because it will include a Base64().toString() serialization of the file.
Based on the original code, I created a sample code in Python that will read a local file, encode the file and then make the http request.
It works almost without a change, and here is a sample output that also includes a call to the next sample, which process the JSON response, this sample may also help!
Tomorrow I'll show a live webcam real-time analysis using the Azure ML Endpoint to detect Squirrels or Space Wolves!