For the complete documentation index, see llms.txt. This page is also available as Markdown.

Usage

Celantur SDK guide for model compilation and inference

Check out the SDK library reference and examples.

Example
What it demonstrates

Minimal CPU anonymisation with the ONNX inference engine, plus tuning inference settings such as thread count and optimisation level.

Compile and run a model with the OpenVINO CPU inference engine.

Compile and run a model on GPU with TensorRT, including precision and optimisation level.

Full GPU inference pipeline without copying image data back to the CPU.

Video processing with object tracking using a smaller model.

Full CPU workflow: JPEG decode/encode with EXIF preservation, detection visualisation, per-class counts, and metric serialisation.

Workflow for model compilation

The default model is ONNX. You can transcompile the model to OpenVINO for better performance on Intel CPUs or TensorRT for better performance on NVIDIA GPUs.

For NVIDIA GPUs, you need to compile a new model for each type of GPU architecture.

  1. Create instance of ModelCompiler

  2. Get settings InferenceEnginePluginCompileSettings from ModelCompiler.preload_model(model_path);

  3. Optional: Adjust settings InferenceEnginePluginCompileSettings

  4. Execute model compilation with ModelCompiler.compile_mode()

Example code for TensorRT

#include "CelanturSDKInterface.h"
#include "CommonParameters.h"

// 1. Create instance of ModelCompiler
CelanturSDK::ModelCompilerParams compiler_params;
compiler_params.inference_plugin = "/usr/local/lib/libTensorRTRuntime.so";
CelanturSDK::ModelCompiler compiler("/path/to/license", compiler_params);

// 2. Get settings
celantur::InferenceEnginePluginCompileSettings settings = compiler.preload_model("/path/to/model.onnx.enc");

// 3. Adjust settings       
settings["precision"] = celantur::CompilePrecision::FP32;
settings["optimisation_level"] = celantur::OptimisationLevel::Low;

// 4. Compile model
compiler.compile_model(settings, model_path_compiled);

Workflow for inference and blurring

Initialise process engine

  1. Create instance of Processor using the model.

  2. Get InferenceEnginePluginSettings from Processor.get_inference_settings()

  3. Optional: Adjust inference settings.

  4. Load model with your adjusted settings.

Example Code

Run inference and blurring

  1. Run inference with Processor.process()

  2. Get anonymised image with Processor.get_result()

  3. Get detections with Processor.get_detections() (necessary step to remove item from queue).

Example Code

Last updated