Public entry point for Luxonis NN Archive creation and inspection.
The luxonis_ml.nn_archive package collects the schema models and helper
functions used to create NN Archive tar files. An archive stores
config.json alongside compiled model executables so model metadata,
input/output definitions, tensor layouts, and parser-head configuration can
travel with the executable artifact.
Example
Build a validated archive with the package-level imports.
from luxonis_ml.nn_archive import ArchiveGenerator generator = ArchiveGenerator( archive_name="model", save_path="artifacts", cfg_dict=config, executables_paths=["model.blob"], ) archive_path = generator.make_archive()
See Also
luxonis_ml.nn_archive.config_building_blocks for the input, output,
metadata, and parser-head schemas used by Model.
| Module | archive |
Undocumented |
| Module | config |
Undocumented |
| Package | config |
Undocumented |
| Module | model |
Undocumented |
| Module | utils |
Undocumented |
| Module | __main__ |
No module docstring; 0/1 variable, 2/2 functions documented |
From __init__.py:
| Class | |
Build NN Archive files from configuration and model executables. |
| Class | |
Configuration schema for an NN Archive. |
| Class | |
Configuration for one model stage in an NN Archive. |
| Function | infer |
Infer a layout code for a tensor shape. |
| Function | is |
Check whether a path points to a valid NN Archive. |
Infer a layout code for a tensor shape.
The function recognizes common image tensor layouts. For other shapes, it uses the first available letters starting at C.
Example
>>> infer_layout([1, 3, 256, 256]) 'NCHW' >>> infer_layout([256, 256, 3]) 'HWC' >>> infer_layout([1, 19, 7, 8]) 'NCDE'
| Parameters | |
shape:list[ | Tensor shape to infer from. |
| Returns | |
str | Layout code matching the number of dimensions in shape. |
| Raises | |
ValueError | If the shape has too many dimensions for automatic layout inference. |