AI Based Object Redaction/Examples/Library Examples

From RidgeRun Developer Wiki
Revision as of 19:49, 20 December 2023 by Nmorua (talk | contribs) (Created page with "=== 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. <source lang=C++> std::shared_ptr<rd::IBackend> backend = std::make_shared<rd::gpu::Backend>(); </source> In case the input buffer is not already in GPU memory, we also need to create a CP...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.