updated API usage (supports remote calls)

This commit is contained in:
三洋三洋
2024-02-27 07:13:36 +00:00
parent b4537944d0
commit 3527a4af47
3 changed files with 22 additions and 10 deletions

View File

@@ -3,9 +3,12 @@ import requests
url = "http://127.0.0.1:8000/predict"
img_path = "/your/image/path/"
with open(img_path, 'rb') as img:
files = {'img': img}
response = requests.post(url, files=files)
data = {"img_path": img_path}
# data = {"img_path": img_path}
response = requests.post(url, json=data)
# response = requests.post(url, json=data)
print(response.text)