Jump to content

AI Based Object Redaction/Examples/Library Examples: Difference between revisions

Line 3: Line 3:
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.  
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++>
<syntaxhighlight lang=C++>
std::shared_ptr<rd::IBackend> backend = std::make_shared<rd::gpu::Backend>();
std::shared_ptr<rd::IBackend> backend = std::make_shared<rd::gpu::Backend>();
</source>
</syntaxhighlight>


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.
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.
704

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.