Skip to content

Instantly share code, notes, and snippets.

@sdcubber
Last active July 30, 2018 15:57
Show Gist options
  • Save sdcubber/1786617678c9a1ddcee9b113ad54036e to your computer and use it in GitHub Desktop.
Save sdcubber/1786617678c9a1ddcee9b113ad54036e to your computer and use it in GitHub Desktop.
import requests
import json
image = img_to_array(load_img('./data/train/train_10001.jpg', target_size=(128,128))) / 255.
payload = {
"instances": [{'input_image': image.tolist()}]
}
r = requests.post('http://localhost:9000/v1/models/PlanetModel:predict', json=payload)
json.loads(r.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment