AI Based Object Redaction/Examples/Library Examples
Backend
First, we create the backend object. The backend provides factories to create the redaction algorithm and buffers. It provides the user the ability to select the desired backend for the execution of the algorithm for object redaction. The backend could be CPU or GPU.
std::shared_ptr<rd::IBackend> backend = std::make_shared<rd::gpu::Backend>();
In case the input buffer is not already in GPU memory, we also need to create a CPU backend to allocate the buffer in CPU memory.
std::shared_ptr<rd::IBackend> cpu_backend = std::make_shared<rd::cpu::Backend>();
Get algorithm
The GetAlgorithm method is used to obtain the redaction algorithm to process the input buffer.