Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #How to infer using Python.
  2. import json
  3. import requests
  4. import base64
  5.  
  6. API_LINK = "" #Your API URL goes here
  7.  
  8. data_to_send = [] #Data you want to send for prediction goes here
  9. response = requests.post(
  10. API_LINK,
  11. headers={"Content-type": "application/json"},
  12. data=json.dumps({
  13. 'input': data_to_send,
  14. }))
  15. result = response.json()
  16. print(result) #Prediction response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement