Updated on 2023-06-15 GMT+08:00

Creating Models

This section describes how to construct a model. HiLens Kit can use the models supported by the Ascend 310 for inference. Use this method to construct a model for subsequent inference. If the model fails to be constructed, the system displays CreateError and an error code is recorded in the log (for example, 0x1013011 indicates that the model path is incorrect). When the returned object is destructed, the corresponding model resource is released.

API Calling

static std::shared_ptr<Model> hilens::Model::Create(const std::string & filename)

Parameter Description

Table 1 Parameters

Parameter

Description

filename

Path of the model file. If the model is stored in ./mymodels/test.om, the file name is ./mymodels/test.om.

Return Value

If the operation is successful, the pointer of the model manager instance is returned. If the operation fails, nullptr is returned.