Skip to content

Instantly share code, notes, and snippets.

@danleyb2
Created January 12, 2022 10:18
Show Gist options
  • Save danleyb2/2ff0e17133a5eddc7917123cbba54e83 to your computer and use it in GitHub Desktop.
Save danleyb2/2ff0e17133a5eddc7917123cbba54e83 to your computer and use it in GitHub Desktop.
def run_rec(i):
print(f'run_rec({i})')
with open(i, 'rb') as fp:
response = requests.post(
'https://container-api.parkpow.com/api/v1/predict/',
data= dict(
# config=c,
),
files=dict(image=fp),
headers={ 'Authorization': 'Token '+API_TOKEN, }
)
print(response)
print(response.text)
# print(json.dumps(response.json(), indent=2))
if response.status_code == 201:
return response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment