npu.lib package#
Subpackages#
- npu.lib.applications package
- npu.lib.cached package
- npu.lib.kernels package
- Submodules
- npu.lib.kernels.addweighted module
- npu.lib.kernels.bitwiseand module
- npu.lib.kernels.bitwiseor module
- npu.lib.kernels.filter2d module
- npu.lib.kernels.gray2rgba module
- npu.lib.kernels.inrange module
- npu.lib.kernels.inverse module
- npu.lib.kernels.kernelgenerator module
- npu.lib.kernels.median module
- npu.lib.kernels.plusn module
- npu.lib.kernels.rgba2gray module
- npu.lib.kernels.rgba2hue module
- npu.lib.kernels.rgba_inverse module
- npu.lib.kernels.threshold module
- Module contents
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.
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()
Kernels#
List the available kernels with
from npu.utils import aiekernels aiekernels()
Graphs#
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.