Spaces:
Running
Running
File size: 336 Bytes
cb92718 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import sys
import requests
if len(sys.argv) != 2:
raise SystemExit("Usage: python scripts/test_request.py path/to/image.jpg")
image_path = sys.argv[1]
url = "http://127.0.0.1:8000/predict"
with open(image_path, "rb") as f:
response = requests.post(url, files={"file": f})
print(response.status_code)
print(response.json())
|