Examples

Anonymize an image (Python)

import requests
​
def main():
credentials = {'username': 'xxx', 'password': 'xxx'}
response = requests.post('https://api.celantur.com/v1/signin/', json=credentials, headers={'Content-Type':'application/json'})
auth_token = response.json()['AuthenticationResult']['AccessToken']
​
with open('image.jpg','rb') as f:
image = f.read()
​
response = requests.post('https://api.celantur.com/v1/file?method=blur&face=True&name=test.jpg',
data=image,
headers={'Authorization': auth_token}
)
file_id = response.json()['file_id']
​
# wait for image to be processed
​
image_get_response = requests.get('https://api.celantur.com/v1/file/' + file_id + '/anonymized',
headers={'Authorization': auth_token}
)
with open('result.jpg', 'wb') as f:
f.write(image_get_response.content)
if __name__ == "__main__":
main()