Usage
Celantur SDK guide for model compilation and inference
Check out the SDK library reference and examples.
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.
Create instance of
ModelCompilerGet settings
InferenceEnginePluginCompileSettingsfromModelCompiler.preload_model(model_path);Optional: Adjust settings
InferenceEnginePluginCompileSettingsExecute 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);Set the input size of the model if it's different from the default (1280x1280)
Workflow for inference and blurring
Initialise process engine
Create instance of
Processorusing the model.Get
InferenceEnginePluginSettingsfromProcessor.get_inference_settings()Optional: Adjust inference settings.
Load model with your adjusted settings.
Example Code
Add parameters for tiling and detection thresholds:
Add parameters for anonymization:
Specify the input size when loading model if it's different from the default (1280x1280):
Run inference and blurring
Run inference with
Processor.process()Get anonymised image with
Processor.get_result()Get detections with
Processor.get_detections()(necessary step to remove item from queue).
Example Code
Last updated