npu.lib package#


Module contents#

Library of prebuilts#

The NPU submodule npu.lib contains prebuilt binaries for various vision applications, optimized C++ kernel sources and pre-defined graphs to help quickly build custom applications.


Prebuilt applications can be run as-is with no additional build steps required.

You can list the available videoapps with

from npu.utils import videoapps videoapps()

Example running edge detect

from npu.lib import EdgeDetectVideoProcessing

app = EdgeDetectVideoProcessing() app.start()


List the available kernels with

from npu.utils import aiekernels aiekernels()


Pre-defined graphs are classes that inherit functionality from AppBuilder and make it simple to insert your own kernel into an NPU application without worrying too much about setting up the graph for dataflow.

Example using an RGB720pBuilder class with a custom kernel object

from npu.lib.graphs.graph_1ct import RGB720pBuilder app_builder = RGB720pBuilder(kernel=passthrough)

This graph is specifically designed to work with 720p RGBA data, in applications which have one input and one output buffer.