NNModelInfo
typedef void* (*nn_create_model_func_t)();
typedef void* (*nn_create_model_func_with_args_t)(int argc, const char** argv);
class NNModelInfo
{
public:
NNModelInfo(
std::string modelName,
nn_create_model_func_t createFunc,
nn_create_model_func_with_args_t createFuncWithArgs);
public:
std::shared_ptr<NNModel> createModel();
std::shared_ptr<NNModel> createModel(std::vector<std::string> arguments);
public:
std::string getModelName();
std::string getTestImage();
void setTestImage(std::string testImage);
std::shared_ptr<NNRect> getTestImageRoi();
void setTestImageRoi(std::shared_ptr<NNRect> testImageRoi);
};
Introduction to the Class
Represents information about a neural network model, including its name, creation functions, and test image details.
The `NNModelInfo` class encapsulates the necessary information to create an instance of a neural network model, as well as details about a test image that can be used for evaluation or testing purposes. It provides methods to retrieve the model name, set and get the test image and its region of interest (ROI).
Introduction to the Class's Methods
NNModelInfo(std::string modelName, nn_create_model_func_t createFunc, nn_create_model_func_with_args_t createFuncWithArgs)
brief: Constructor. Initializes the `NNModelInfo` object with the model name and creation functions.
param
modelName: The name of the neural network model.
createFunc: A function pointer to a function that creates an instance of the model without arguments.
createFuncWithArgs: A function pointer to a function that creates an instance of the model with a vector of arguments.
std::shared_ptr<NNModel> createModel()
brief: Creates an instance of the neural network model without any arguments.
return hared_ptr<NNModel>: A shared pointer to a new `NNModel` instance.
std::shared_ptr<NNModel> createModel(std::vector<std::string> arguments)
brief: Creates an instance of the neural network model with the specified arguments.
param
arguments: A vector of arguments to pass to the model creation function.
return hared_ptr<NNModel>: A shared pointer to a new `NNModel` instance.
std::string getModelName()
brief: Retrieves the name of the model.
return string: The model name.
std::string getTestImage()
brief: Retrieves the path to the test image used for the model.
return string: The path to the test image.
void setTestImage(std::string testImage)
brief: Sets the path or identifier of the test image.
param
testImage: The path or identifier of the test image to set.
std::shared_ptr<NNRect> getTestImageRoi():
brief: Retrieves the region of interest (ROI) for the test image.
return std::shared_ptr<NNRect>: A shared pointer to the ROI object.
void setTestImageRoi(std::shared_ptr<NNRect> testImageRoi):
brief: Sets the region of interest (ROI) for the test image.
param
testImageRoi: A shared pointer to an `NNRect` object representing the ROI to set.