Batch and Stream mode

Celantur Container batch and stream mode allow you to anonymize images and videos stored on the local file system.
How to use Celantur Container video


The following folders are necessary:
├── input/
├── licensing/
├── log/
└── output/
  • input: Where the original files are stored(including subfolders)
    • For images, following formats are supported: .jpg / .jpeg, .png, .tif / .tiff, .bmp and .jfif.
    • For videos, following formats are supported: .mpeg, .mp4 and .avi.
  • output: Folder for the anonymized images/videos. If a file exists with the same as in input folder, then processing of the file is skipped.
  • log: Folder containing the logs.
  • licensing: Folder containing the license key. Copy the license file license into this folder as licensing/license.
You will be provided the script files mentioned below by the Celantur team.

Starting in Batch mode

Starting the Container in Batch mode triggers a processing of all files in the input folder. After files have been processed, the Container is shut down.
./ -a face -a license-plate -f whole

Starting in Stream mode

Stream mode keeps the Container continuously checking the input folder for new files that have to be processed. The delay between checks can be specified in seconds. The Container needs to be shut down manually.
./ --stream -a face -a license-plate -f whole
Stream mode does not support video processing yet. This will be part of a later release.

Image and video processing

By default, Celantur Container processes images. Video processing has to be specified by adding the --video parameter.
Images: ./ -a face -a license-plate -f whole
Videos: ./ --video -a face -a license-plate -f whole


You can edit ./ <parameters> to modify the behavior of Celantur Container. Experienced Linux user can modify the script
--anonymise {face, license-plate, person, vehicle} -a {face, license-plate, person, vehicle}
Specify objects to be anonymized.
--format FORMAT -f FORMAT
Specify image format, to control how an image should be processed. Default: whole
Image tiling for improved anonymization results and limiting the anonymization to a specific section of the image can be specified here as well.
See Image Format section for reference or check usage with ./ -h.
--help -h
Prints help message with all parameters and exits.
Anonymizes objects with bounding boxes
Enables debug mode. Bounding boxes of detected objects are displayed on images.
Prints the certainty scores of detected objects on images, if debug mode is enabled.
Disables GPU utilization. See Using CPU only
--method {blur, pixelate, blacken, detect}
Choose anonymization method (default: blur)
--metrics <filename.json>
File name for metrics (default: metrics.json)
--quality [1..100]
Quality of output (JPEG) image (default: 90)
Overwrite existing files in output folder.
--stream [seconds]
Streaming mode (Wait time in seconds).
--server <host:port>
--server-array <host:port>
Anonymize videos.
--person-threshold [0..1]
Threshold for whole person detection.
--vehicle-threshold [0..1]
Threshold for vehicle detection.
--face-threshold [0..1]
Threshold for face detection.
--license-plate-threshold [0..1]
Threshold for license plate detection.
--save-mask {all, instance, binary}
Generate binary and instance segmentation mask files per processed images. See Segmentation Masks.
--mask-scale {0..100}
Scales binary and instance segmentation mask files down by the specified ratio. See Segmentation Masks.
For more arguments, check ./ --help.

Image format

By specifying image format settings, Celantur Container can achieve improved anonymization results and apply anonymization only to a specific region of an image.
--format '{"number":[nx,ny],"overlap":[ox,oy],"section":[x1,y1,x2,y2]}'
Don't use spaces in the format string. Otherwise Bash has problems interpreting it as one argument.

Custom tiling for improved results

In certain cases, its beneficial to process high-resolution imagery in tiles, instead of the whole image. Small, distant objects are more likely to be detected.
--format '{"number":[nx,ny],"overlap":[ox,oy]}'
Number of horizontal tiles
Number of vertical tiles
Horizontal overlap between tiles in pixels
Vertical overlap between tiles in pixels

Limit anonymization to a section of the image

Apply anonymization only to a specified rectangular section of the image. This can result in faster processing time.
--format '{"number":[1,1],"overlap":[0,0],"section":[x1,y1,x2,y2]}'
number and overlap attribute are required when specifying the section, as seen in the example above.
x1, y1
Top left coordinate of the section
x2, y2
Bottom right coordinate of the section

Predefined formats

Alternatively, you can use the option --format to choose the resolution of the input images, eg. --format pano:8000 for an image resolution of 8000x4000. Use --format whole for all formats not listed below, or if the input images have different resolutions.
default, valid for all resolutions


How do I use input/output folders on an external drive?

You can use symbolic links (see ln for reference) for the input and output folders, e.g. in the folder with the script:
# set "input" as a symbolic link to an external drive
ln -s /path/to/external/drive/input-images input
# set "output" as a symbolic link to an external drive
ln -s /path/to/external/drive/output-images output

Can I start multiple container instances on one machine?

Yes, this is possible and can lead to a higher throughput when you process images, by having several container instances working in parallel. Please make sure that your system has enough resources available.
Run the following command as many times as how many container instances you want to start: --detach
The --detach flag is supported starting from version 22.06.3.
Note that this will start container in the detached mode and you will not be able to observe the text output. To inspect which containers are currently running use docker ps, which will also print the container IDs. To inspect log outputs of a particular container, use docker logs <container_id>. Finally, to stop the container use docker kill <container_id> && docker rm <container_id>
It's highly recommended to assign dedicated input/output folders to each container instance, when using the batch/stream mode.
To do that, either run from the corresponding processing folder, or use export PROCESS_DIR=<processing_directory_for_this_container> before

"Permission denied" error when writing files

Problem: [Errno 13] Permission denied: '/path/to/file'
In Docker, if you mount a directory to Docker that does not exist, Docker creates the folder as root. Inside Docker container, the user (with UID 1000) cannot write in the directory.
Solution: Create the folders output and log before you mount them and ensure that the file owner has UID 1000.
mkdir log output
sudo chown 1000:1000 log output
Alternatively, give everyone write permission to log and output:
mkdir log output
chmod 777 log output

"Read-only file system" error when writing files

Problem: [Errno 30] Read-only file system: '/path/to/file'
Solution: The folder is mounted in Docker as read-only. Remove the appendix :ro from the -v parameter.