Created
January 12, 2022 10:18
-
-
Save danleyb2/2ff0e17133a5eddc7917123cbba54e83 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
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