Created
September 9, 2019 06:06
-
-
Save naxty/324bd20378c6c0d69f0eeb37804285ca to your computer and use it in GitHub Desktop.
REST Client for local seldon core docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import numpy as np | |
import requests | |
path_to_image = "images/smile.jpg" | |
image = Image.open(path_to_image).convert('L') | |
resized = image.resize((64, 64)) | |
values = np.array(resized).reshape(1, 1, 64, 64) | |
req = requests.post("http://localhost:5000/predict", json={"data":{"ndarray": values.tolist()}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment