Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,333 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I want to test my endpoint. My data are images.
Here's what is indicated for input data :
{
"input_data": {
"columns": [
"image"
],
"index": [],
"data": []
}
}
But how do I give my images ? What sould I add in this json file ?
I found the answer :
image_path = 'path/to/image.png'
# Read the image and encode it as base64
with open(image_path, "rb") as img_file:
image_data = base64.b64encode(img_file.read()).decode('utf-8')
# Structure the data payload
data = {
"input_data": {
"columns": [
"image"
],
"index": [0], #index of the image data
"data": [image_data]
}
}
body = str.encode(json.dumps(data))