Created
September 20, 2019 11:40
-
-
Save dipanjanS/ce57b5d6dc71826e098eb814ec5fb945 to your computer and use it in GitHub Desktop.
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
import base64 | |
import requests | |
with open('sneaker.jpg', "rb") as imageFile: | |
img_b64enc = base64.b64encode(imageFile.read()) | |
data = {'b64_img': img_b64enc} | |
API_URL = 'http://0.0.0.0:5000/apparel_classifier/api/v1/model2_predict' | |
# sending post request and saving response as response object | |
r = requests.post(url=API_URL, data=data) | |
r.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment