2021-12-07 10:57:55 +08:00
|
|
|
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
|
2021-12-24 18:43:26 +08:00
|
|
|
/**
|
|
|
|
* @file model.h
|
|
|
|
* @brief Interface to MMDeploy SDK Model
|
|
|
|
*/
|
|
|
|
|
2021-12-07 10:57:55 +08:00
|
|
|
#ifndef MMDEPLOY_SRC_APIS_C_MODEL_H_
|
|
|
|
#define MMDEPLOY_SRC_APIS_C_MODEL_H_
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2021-12-24 18:43:26 +08:00
|
|
|
/**
|
|
|
|
* @brief Create SDK Model instance from given model path
|
|
|
|
* @param[in] path model path
|
|
|
|
* @param[out] model sdk model instance that must be destroyed by \ref mmdeploy_model_destroy
|
|
|
|
* @return status code of the operation
|
|
|
|
*/
|
|
|
|
MM_SDK_API int mmdeploy_model_create_by_path(const char* path, mm_model_t* model);
|
2021-12-07 10:57:55 +08:00
|
|
|
|
2021-12-24 18:43:26 +08:00
|
|
|
/**
|
|
|
|
* @brief Create SDK Model instance from memory
|
|
|
|
* @param[in] buffer a linear buffer contains the model information
|
|
|
|
* @param[in] size size of \p buffer in bytes
|
|
|
|
* @param[out] model sdk model instance that must be destroyed by \ref mmdeploy_model_destroy
|
|
|
|
* @return status code of the operation
|
|
|
|
*/
|
|
|
|
MM_SDK_API int mmdeploy_model_create(const void* buffer, int size, mm_model_t* model);
|
2021-12-07 10:57:55 +08:00
|
|
|
|
2021-12-24 18:43:26 +08:00
|
|
|
/**
|
|
|
|
* @brief Destroy model instance
|
|
|
|
* @param[in] model sdk model instance created by \ref mmdeploy_model_create_by_path or \ref
|
|
|
|
* mmdeploy_model_create
|
|
|
|
*/
|
|
|
|
MM_SDK_API void mmdeploy_model_destroy(mm_model_t model);
|
2021-12-07 10:57:55 +08:00
|
|
|
|
|
|
|
#endif // MMDEPLOY_SRC_APIS_C_MODEL_H_
|