nndeploy C++ API  0.2.0
nndeploy C++ API
Public Member Functions | Public Attributes | List of all members
nndeploy::inference::InferenceParam Class Reference

InferenceParam is the base class of all inference param. More...

#include <inference_param.h>

Inheritance diagram for nndeploy::inference::InferenceParam:
[legend]
Collaboration diagram for nndeploy::inference::InferenceParam:
[legend]

Public Member Functions

virtual base::Status deserialize (rapidjson::Value &json)
 
virtual base::Status get (const std::string &key, base::Any &any)
 获取参数 More...
 
const std::vector< std::string > & getCachePath () const
 
base::DeviceType getDeviceType () const
 
base::EncryptType getEncryptType () const
 
int getGpuTuneKernel () const
 
base::InferenceType getInferenceType () const
 
const std::vector< std::string > & getInputName () const
 
int getInputNum () const
 
const std::vector< std::vector< int > > & getInputShape () const
 
bool getIsDynamicShape () const
 
bool getIsPath () const
 
const std::vector< std::string > & getLibraryPath () const
 
const std::string & getLicense () const
 
const base::ShapeMapgetMaxShape () const
 
const base::ShapeMapgetMinShape () const
 
base::ModelType getModelType () const
 
const std::vector< std::string > & getModelValue () const
 
int getNumThread () const
 
const base::ShapeMapgetOptShape () const
 
const std::vector< std::string > & getOutputName () const
 
int getOutputNum () const
 
base::PowerType getPowerType () const
 
base::PrecisionType getPrecisionType () const
 
base::ShareMemoryType getShareMemoryMode () const
 
 InferenceParam ()
 
 InferenceParam (base::InferenceType type)
 
 InferenceParam (const InferenceParam &param)=default
 
InferenceParamoperator= (const InferenceParam &param)=default
 
virtual base::Status serialize (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator)
 
virtual base::Status set (const std::string &key, base::Any &any)
 设置参数 More...
 
void setCachePath (const std::vector< std::string > &cache_path)
 
void setDeviceType (base::DeviceType type)
 
void setEncryptType (base::EncryptType type)
 
void setGpuTuneKernel (int gpu_tune_kernel)
 
void setInferenceType (base::InferenceType type)
 
void setInputName (const std::string &input_name, int i=-1)
 
void setInputName (const std::vector< std::string > &input_name)
 
void setInputNum (int input_num)
 
void setInputShape (const std::vector< int > &input_shape, int i=-1)
 
void setInputShape (const std::vector< std::vector< int >> &input_shape)
 
void setIsDynamicShape (bool is_dynamic_shape)
 
void setIsPath (bool is_path)
 
void setLibraryPath (const std::string &library_path, int i=-1)
 
void setLibraryPath (const std::vector< std::string > &library_path)
 
void setLicense (const std::string &license)
 
void setMaxShape (const base::ShapeMap &max_shape)
 
void setMinShape (const base::ShapeMap &min_shape)
 
void setModelType (base::ModelType type)
 
void setModelValue (const std::string &model_value, int i=-1)
 
void setModelValue (const std::vector< std::string > &model_value)
 
void setNumThread (int num_thread)
 
void setOptShape (const base::ShapeMap &opt_shape)
 
void setOutputName (const std::string &output_name, int i=-1)
 
void setOutputName (const std::vector< std::string > &output_name)
 
void setOutputNum (int output_num)
 
void setPowerType (base::PowerType type)
 
void setPrecisionType (base::PrecisionType type)
 
void setShareMemoryMode (base::ShareMemoryType mode)
 
virtual ~InferenceParam ()
 
- Public Member Functions inherited from nndeploy::base::Param
base::Status addDropdownParam (const std::string &dropdown_param, const std::vector< std::string > &dropdown_values)
 
base::Status addIoParam (const std::string &io_param)
 
base::Status addRequiredParam (const std::string &required_param)
 
base::Status addUiParam (const std::string &ui_param)
 
base::Status clearDropdownParams ()
 
base::Status clearIoParams ()
 
base::Status clearRequiredParams ()
 
base::Status clearUiParams ()
 
virtual base::Status deserialize (const std::string &json_str)
 
std::map< std::string, std::vector< std::string > > getDropdownParams ()
 
std::vector< std::string > getIoParams ()
 
std::vector< std::string > getRequiredParams ()
 
std::vector< std::string > getUiParams ()
 
virtual base::Status loadFile (const std::string &path)
 
 Param ()
 
base::Status removeDropdownParam (const std::string &dropdown_param)
 
base::Status removeIoParam (const std::string &io_param)
 
base::Status removeRequiredParam (const std::string &required_param)
 
base::Status removeUiParam (const std::string &ui_param)
 
virtual base::Status saveFile (const std::string &path)
 
virtual std::string serialize ()
 
base::Status setDropdownParams (const std::map< std::string, std::vector< std::string >> &dropdown_params)
 
base::Status setIoParams (const std::vector< std::string > &io_params)
 
base::Status setRequiredParams (const std::vector< std::string > &required_params)
 
base::Status setUiParams (const std::vector< std::string > &ui_params)
 
virtual ~Param ()
 

Public Attributes

std::vector< std::string > cache_path_ = {""}
 
base::DeviceType device_type_
 
base::EncryptType encrypt_type_
 
std::vector< std::string > external_model_data_
 
int gpu_tune_kernel_ = 1
 
base::InferenceType inference_type_ = base::kInferenceTypeNotSupport
 
std::vector< std::string > input_name_
 
int input_num_ = 1
 
std::vector< std::vector< int > > input_shape_
 
bool is_dynamic_shape_ = false
 
bool is_path_ = true
 
std::vector< std::string > library_path_ = {""}
 
std::string license_
 
base::ShapeMap max_shape_ = base::ShapeMap()
 
base::ShapeMap min_shape_ = base::ShapeMap()
 
base::ModelType model_type_ = base::kModelTypeOnnx
 
std::vector< std::string > model_value_
 
int num_thread_ = 4
 
base::ShapeMap opt_shape_ = base::ShapeMap()
 
std::vector< std::string > output_name_
 
int output_num_ = 1
 
base::ParallelType parallel_type_ = base::kParallelTypeSequential
 
base::PowerType power_type_ = base::kPowerTypeNormal
 
base::PrecisionType precision_type_
 
base::ShareMemoryType share_memory_mode_
 
int worker_num_ = 1
 
- Public Attributes inherited from nndeploy::base::Param
std::map< std::string, std::vector< std::string > > dropdown_params_
 
std::vector< std::string > io_params_
 
std::vector< std::string > required_params_
 
std::vector< std::string > ui_params_
 

Detailed Description

InferenceParam is the base class of all inference param.

Definition at line 22 of file inference_param.h.

Constructor & Destructor Documentation

◆ InferenceParam() [1/3]

nndeploy::inference::InferenceParam::InferenceParam ( )

◆ InferenceParam() [2/3]

nndeploy::inference::InferenceParam::InferenceParam ( base::InferenceType  type)

◆ ~InferenceParam()

virtual nndeploy::inference::InferenceParam::~InferenceParam ( )
virtual

◆ InferenceParam() [3/3]

nndeploy::inference::InferenceParam::InferenceParam ( const InferenceParam param)
default

Member Function Documentation

◆ deserialize()

virtual base::Status nndeploy::inference::InferenceParam::deserialize ( rapidjson::Value &  json)
virtual

Reimplemented from nndeploy::base::Param.

◆ get()

virtual base::Status nndeploy::inference::InferenceParam::get ( const std::string &  key,
base::Any &  any 
)
virtual

获取参数

Parameters
key
value
Returns
base::Status

Reimplemented from nndeploy::base::Param.

◆ getCachePath()

const std::vector<std::string>& nndeploy::inference::InferenceParam::getCachePath ( ) const

◆ getDeviceType()

base::DeviceType nndeploy::inference::InferenceParam::getDeviceType ( ) const

◆ getEncryptType()

base::EncryptType nndeploy::inference::InferenceParam::getEncryptType ( ) const

◆ getGpuTuneKernel()

int nndeploy::inference::InferenceParam::getGpuTuneKernel ( ) const

◆ getInferenceType()

base::InferenceType nndeploy::inference::InferenceParam::getInferenceType ( ) const

◆ getInputName()

const std::vector<std::string>& nndeploy::inference::InferenceParam::getInputName ( ) const

◆ getInputNum()

int nndeploy::inference::InferenceParam::getInputNum ( ) const

◆ getInputShape()

const std::vector<std::vector<int> >& nndeploy::inference::InferenceParam::getInputShape ( ) const

◆ getIsDynamicShape()

bool nndeploy::inference::InferenceParam::getIsDynamicShape ( ) const

◆ getIsPath()

bool nndeploy::inference::InferenceParam::getIsPath ( ) const

◆ getLibraryPath()

const std::vector<std::string>& nndeploy::inference::InferenceParam::getLibraryPath ( ) const

◆ getLicense()

const std::string& nndeploy::inference::InferenceParam::getLicense ( ) const

◆ getMaxShape()

const base::ShapeMap& nndeploy::inference::InferenceParam::getMaxShape ( ) const

◆ getMinShape()

const base::ShapeMap& nndeploy::inference::InferenceParam::getMinShape ( ) const

◆ getModelType()

base::ModelType nndeploy::inference::InferenceParam::getModelType ( ) const

◆ getModelValue()

const std::vector<std::string>& nndeploy::inference::InferenceParam::getModelValue ( ) const

◆ getNumThread()

int nndeploy::inference::InferenceParam::getNumThread ( ) const

◆ getOptShape()

const base::ShapeMap& nndeploy::inference::InferenceParam::getOptShape ( ) const

◆ getOutputName()

const std::vector<std::string>& nndeploy::inference::InferenceParam::getOutputName ( ) const

◆ getOutputNum()

int nndeploy::inference::InferenceParam::getOutputNum ( ) const

◆ getPowerType()

base::PowerType nndeploy::inference::InferenceParam::getPowerType ( ) const

◆ getPrecisionType()

base::PrecisionType nndeploy::inference::InferenceParam::getPrecisionType ( ) const

◆ getShareMemoryMode()

base::ShareMemoryType nndeploy::inference::InferenceParam::getShareMemoryMode ( ) const

◆ operator=()

InferenceParam& nndeploy::inference::InferenceParam::operator= ( const InferenceParam param)
default

◆ serialize()

virtual base::Status nndeploy::inference::InferenceParam::serialize ( rapidjson::Value &  json,
rapidjson::Document::AllocatorType &  allocator 
)
virtual

Reimplemented from nndeploy::base::Param.

◆ set()

virtual base::Status nndeploy::inference::InferenceParam::set ( const std::string &  key,
base::Any &  any 
)
virtual

设置参数

Parameters
key
value
Returns
base::Status

Reimplemented from nndeploy::base::Param.

◆ setCachePath()

void nndeploy::inference::InferenceParam::setCachePath ( const std::vector< std::string > &  cache_path)

◆ setDeviceType()

void nndeploy::inference::InferenceParam::setDeviceType ( base::DeviceType  type)

◆ setEncryptType()

void nndeploy::inference::InferenceParam::setEncryptType ( base::EncryptType  type)

◆ setGpuTuneKernel()

void nndeploy::inference::InferenceParam::setGpuTuneKernel ( int  gpu_tune_kernel)

◆ setInferenceType()

void nndeploy::inference::InferenceParam::setInferenceType ( base::InferenceType  type)

◆ setInputName() [1/2]

void nndeploy::inference::InferenceParam::setInputName ( const std::string &  input_name,
int  i = -1 
)

◆ setInputName() [2/2]

void nndeploy::inference::InferenceParam::setInputName ( const std::vector< std::string > &  input_name)

◆ setInputNum()

void nndeploy::inference::InferenceParam::setInputNum ( int  input_num)

◆ setInputShape() [1/2]

void nndeploy::inference::InferenceParam::setInputShape ( const std::vector< int > &  input_shape,
int  i = -1 
)

◆ setInputShape() [2/2]

void nndeploy::inference::InferenceParam::setInputShape ( const std::vector< std::vector< int >> &  input_shape)

◆ setIsDynamicShape()

void nndeploy::inference::InferenceParam::setIsDynamicShape ( bool  is_dynamic_shape)

◆ setIsPath()

void nndeploy::inference::InferenceParam::setIsPath ( bool  is_path)

◆ setLibraryPath() [1/2]

void nndeploy::inference::InferenceParam::setLibraryPath ( const std::string &  library_path,
int  i = -1 
)

◆ setLibraryPath() [2/2]

void nndeploy::inference::InferenceParam::setLibraryPath ( const std::vector< std::string > &  library_path)

◆ setLicense()

void nndeploy::inference::InferenceParam::setLicense ( const std::string &  license)

◆ setMaxShape()

void nndeploy::inference::InferenceParam::setMaxShape ( const base::ShapeMap max_shape)

◆ setMinShape()

void nndeploy::inference::InferenceParam::setMinShape ( const base::ShapeMap min_shape)

◆ setModelType()

void nndeploy::inference::InferenceParam::setModelType ( base::ModelType  type)

◆ setModelValue() [1/2]

void nndeploy::inference::InferenceParam::setModelValue ( const std::string &  model_value,
int  i = -1 
)

◆ setModelValue() [2/2]

void nndeploy::inference::InferenceParam::setModelValue ( const std::vector< std::string > &  model_value)

◆ setNumThread()

void nndeploy::inference::InferenceParam::setNumThread ( int  num_thread)

◆ setOptShape()

void nndeploy::inference::InferenceParam::setOptShape ( const base::ShapeMap opt_shape)

◆ setOutputName() [1/2]

void nndeploy::inference::InferenceParam::setOutputName ( const std::string &  output_name,
int  i = -1 
)

◆ setOutputName() [2/2]

void nndeploy::inference::InferenceParam::setOutputName ( const std::vector< std::string > &  output_name)

◆ setOutputNum()

void nndeploy::inference::InferenceParam::setOutputNum ( int  output_num)

◆ setPowerType()

void nndeploy::inference::InferenceParam::setPowerType ( base::PowerType  type)

◆ setPrecisionType()

void nndeploy::inference::InferenceParam::setPrecisionType ( base::PrecisionType  type)

◆ setShareMemoryMode()

void nndeploy::inference::InferenceParam::setShareMemoryMode ( base::ShareMemoryType  mode)

Member Data Documentation

◆ cache_path_

std::vector<std::string> nndeploy::inference::InferenceParam::cache_path_ = {""}

Definition at line 128 of file inference_param.h.

◆ device_type_

base::DeviceType nndeploy::inference::InferenceParam::device_type_

Definition at line 116 of file inference_param.h.

◆ encrypt_type_

base::EncryptType nndeploy::inference::InferenceParam::encrypt_type_
Initial value:

Definition at line 113 of file inference_param.h.

◆ external_model_data_

std::vector<std::string> nndeploy::inference::InferenceParam::external_model_data_

Definition at line 107 of file inference_param.h.

◆ gpu_tune_kernel_

int nndeploy::inference::InferenceParam::gpu_tune_kernel_ = 1

Definition at line 118 of file inference_param.h.

◆ inference_type_

base::InferenceType nndeploy::inference::InferenceParam::inference_type_ = base::kInferenceTypeNotSupport

Definition at line 103 of file inference_param.h.

◆ input_name_

std::vector<std::string> nndeploy::inference::InferenceParam::input_name_

Definition at line 109 of file inference_param.h.

◆ input_num_

int nndeploy::inference::InferenceParam::input_num_ = 1

Definition at line 108 of file inference_param.h.

◆ input_shape_

std::vector<std::vector<int> > nndeploy::inference::InferenceParam::input_shape_

Definition at line 110 of file inference_param.h.

◆ is_dynamic_shape_

bool nndeploy::inference::InferenceParam::is_dynamic_shape_ = false

Definition at line 124 of file inference_param.h.

◆ is_path_

bool nndeploy::inference::InferenceParam::is_path_ = true

Definition at line 105 of file inference_param.h.

◆ library_path_

std::vector<std::string> nndeploy::inference::InferenceParam::library_path_ = {""}

Definition at line 129 of file inference_param.h.

◆ license_

std::string nndeploy::inference::InferenceParam::license_

Definition at line 115 of file inference_param.h.

◆ max_shape_

base::ShapeMap nndeploy::inference::InferenceParam::max_shape_ = base::ShapeMap()

Definition at line 127 of file inference_param.h.

◆ min_shape_

base::ShapeMap nndeploy::inference::InferenceParam::min_shape_ = base::ShapeMap()

Definition at line 125 of file inference_param.h.

◆ model_type_

base::ModelType nndeploy::inference::InferenceParam::model_type_ = base::kModelTypeOnnx

Definition at line 104 of file inference_param.h.

◆ model_value_

std::vector<std::string> nndeploy::inference::InferenceParam::model_value_

Definition at line 106 of file inference_param.h.

◆ num_thread_

int nndeploy::inference::InferenceParam::num_thread_ = 4

Definition at line 117 of file inference_param.h.

◆ opt_shape_

base::ShapeMap nndeploy::inference::InferenceParam::opt_shape_ = base::ShapeMap()

Definition at line 126 of file inference_param.h.

◆ output_name_

std::vector<std::string> nndeploy::inference::InferenceParam::output_name_

Definition at line 112 of file inference_param.h.

◆ output_num_

int nndeploy::inference::InferenceParam::output_num_ = 1

Definition at line 111 of file inference_param.h.

◆ parallel_type_

base::ParallelType nndeploy::inference::InferenceParam::parallel_type_ = base::kParallelTypeSequential

Definition at line 130 of file inference_param.h.

◆ power_type_

base::PowerType nndeploy::inference::InferenceParam::power_type_ = base::kPowerTypeNormal

Definition at line 123 of file inference_param.h.

◆ precision_type_

base::PrecisionType nndeploy::inference::InferenceParam::precision_type_
Initial value:

Definition at line 121 of file inference_param.h.

◆ share_memory_mode_

base::ShareMemoryType nndeploy::inference::InferenceParam::share_memory_mode_
Initial value:

Definition at line 119 of file inference_param.h.

◆ worker_num_

int nndeploy::inference::InferenceParam::worker_num_ = 1

Definition at line 131 of file inference_param.h.


The documentation for this class was generated from the following file: