Struct NNModelDescription

Struct Documentation

struct NNModelDescription

Public Functions

void saveToYamlFile(const fs::path &yamlPath) const

Save NNModelDescription to yaml file.

Parameters:

yamlPath – Path to yaml file

bool check() const

Check if the model description is valid (contains all required fields)

Returns:

bool: True if the model description is valid, false otherwise

std::string toString() const

Convert NNModelDescription to string for printing purposes. This can be used for debugging.

Returns:

std::string: String representation

Public Members

std::string model

Model slug = REQUIRED parameter

std::string platform

Hardware platform - RVC2, RVC3, RVC4, … = REQUIRED parameter

std::string optimizationLevel

Optimization level = OPTIONAL parameter

std::string compressionLevel

Compression level = OPTIONAL parameter

std::string snpeVersion

SNPE version = OPTIONAL parameter

std::string modelPrecisionType

modelPrecisionType = OPTIONAL parameter

std::string globalMetadataEntryName

Name of the entry in the global metadata file

Public Static Functions

static NNModelDescription fromYamlFile(const fs::path &modelName, const fs::path &modelsPath = "")

Initialize NNModelDescription from yaml file If modelName is a relative path (e.g. ./yolo.yaml), it is used as is. If modelName is a full path (e.g. /home/user/models/yolo.yaml), it is used as is. If modelName is a model name (e.g. yolo) or a model yaml file (e.g. yolo.yaml), the function will use modelsPath if provided or the DEPTHAI_ZOO_MODELS_PATH environment variable and use a path made by combining the modelsPath and the model name to the yaml file. For instance, yolo -> ./depthai_models/yolo.yaml (if modelsPath or DEPTHAI_ZOO_MODELS_PATH are ./depthai_models)

Parameters:
  • modelName – model name or yaml file path (string is implicitly converted to Path)

  • modelsPath – Path to the models folder, use environment variable DEPTHAI_ZOO_MODELS_PATH if not provided

Returns:

NNModelDescription