Celantur Documentation
celantur.com
  • Celantur Documentation
  • Container
    • Getting Started
    • Requirements and Installation
      • Requirements
      • Installation on Linux
      • Installation on Windows
      • Updates
    • Usage
      • Batch and Stream mode
      • REST API (v1) mode
      • TCP mode
      • Segmentation Masks and Metadata
      • Customize Blurring
      • Using CPU only
      • Object Tracking
    • Benchmarks
    • Release Notes
  • SDK/Edge
    • Getting Started
    • Requirements and Installation
      • Requirements
    • Benchmarks
    • Release Notes
  • Architecture
  • Troubleshooting
  • Cloud API
    • Getting Started
    • Concept
    • Authorization
    • Examples
    • API Endpoints
    • Webhooks
    • v1 (deprecated)
      • v1 API Endpoints (deprecated)
      • v1 Webhooks (deprecated)
      • v1 Examples (deprecated)
      • v1 Authorization (deprecated)
    • Release Notes
  • Tutorials
    • Image Anonymization in Esri ArcGIS Online
    • Image Anonymization in Esri ArcGIS Pro
    • Anonymization of ROS2 .mcap files
    • FARO Blurring Workflow
    • Anonymize Teledyne Flir PGR images
Powered by GitBook
On this page
  1. Cloud API
  2. v1 (deprecated)

v1 Examples (deprecated)

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']

    # query https://api.celantur.com/v1/file/{file_id}/status until status response is "done"

    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()
Previousv1 Webhooks (deprecated)Nextv1 Authorization (deprecated)

Last updated 1 year ago