You can start the Celantur Container in API mode and use the REST API to anonymize images and videos. There are two ways to process images and videos, via synchronous and asynchronous uploads.
When you upload files via synchronous upload, which is the default configuration, it takes some time for you to get the response. You can then immediately download the result.
When you upload files via the asynchronous upload, by adding the header parameter x-is-async: true (and optionally a webhook via the query parameter), you'll immediately receive the response, but the processing is not necessarily finished. If you added a webhook, you'll be notified once processing is finished. Otherwise, you can query the GET /task/{id} to check whether the processing is finished. See more information below.
Start the Container in REST API mode
Start the server with all object types (-a face -a license-plate -a person -a vehicle) that you want to anonymize by using the API. You can select specific objects for individual images using API calls.
Specify the API endpoint that is returned with the requests. URL for downloading the anonymised images, binary masks and metadata.
Task and files
There are two classes of endpoints:
/file endpoints where you can upload and download files. When you upload a file with POST /file you will receive a JSON response including { "id": "string", ... }. You can use the id to query the status of processing via GET /task/{id} endpoint.
/task endpoints where you can query the status of file processing and manage the tasks, especially important for asynchronous processing. For processing, the files are stored internally in the folders specified by the user with the --input and --output parameters.
Currently, you need to manage the storage manually by deleting the files associated with a task with the DELETE /task/{id} to free up stsorage.
Metadata, binary and instance segmentation masks are not yet supported for videos.
Webhook
If you specify a webhook URL in POST /file with the query parameter webhook (urlencoded). You can specify header authentication with web-auth-header-name and web-auth-header-value.
After the file has been processed, the Container will post a request to the he webhook URL with the following header and body (example):
Sychronous processing
Upload image with POST request Upload file.
Processing is ready once the request returns with a successful response.
Upload image with POST request Upload file with the header parameter x-is-async: true.
Request returns immediately with a response. However processing runs asynchronously and is not necessary complete.
Wait until processing is done.
Webhook: If you added webhook, you'll receive notification, once the processing is complete.
In asynchronous mode, you need to pay attention to the storage management. So delete all tasks including files that you have downloaded and are not required anymore. You can delete single tasks DELETE /tast/{id} or all tasks DELETE /task/lists .
Image and video anonymization
We currently support JPEG and PNG images, and MP3 video containers.
Upload file
POSThttps://localhost/v1/file
Upload a file that is processed with the specified method. The container only holds data for one image at any time. A new POST request overwrites the old data.
Query Parameters
Name
Type
Description
method*
String
Enum: blur, pixelate, blacken, detect
Default: blur
Specifies processing method.
Method detect only returns segmentation and binary masks, not an anonymized image.
debug
Boolean
Print bounding boxes and segmentation masks of detected objects on the image.
score
Boolean
Print the detection scores of objects on the image. Works only if debug is true.
face
Boolean
Specifies whether faces should be anonymized/detected.
license-plate
Boolean
Specifies whether license plates should be anonymized/detected.
person
Boolean
Specifies whether persons should be anonymized/detected.
vehicle
Boolean
Specifies whether vehicles should be anonymized/detected.
bbox
Boolean
Anonymize bounding boxes of objects (instead of segmentation)
Areas of the image that are not going to be anonymized
face-threshold
Number
Specifies detection threshold 0..1 for faces.
Default: 0.5
segmentation-threshold
Number
DEPRECATED
Specifies detection threshold value for segmentation.
▶ Use person-threshold and vehicle-threshold instead.
vehicle-threshold
Number
Specifies detection threshold 0..1 for vehicles.
Default: 0.4
person-threshold
Number
Specifies detection threshold 0..1 for persons.
Default: 0.4
license-plate-threshold
Number
Specifies detection threshold 0..1 for license plates.
Default: 0.5
no-object-tracking
Boolean
Disables object tracking in videos, which is enabled by default. See Object Tracking
keep-bit-rate
Boolean
Specifies whether the bitrate of the anonymized video should remain very close to the one of the original video.
Enabling keep-bit-rate will ensure a nearly identically file size of the processed video, at the cost of 10% to 20% higher processing time.
Default: false