SSCMA-Micro CPP SDK  v2.0.0
SSCMA-Micro is a cross-platform machine learning inference framework designed for embedded devices.
ma::model::Classifier Class Reference

#include <ma_model_classifier.h>

Inheritance diagram for ma::model::Classifier:
Collaboration diagram for ma::model::Classifier:

Public Member Functions

 Classifier (Engine *engine)
 
virtual ~Classifier ()
 
const std::forward_list< ma_class_t > & getResults ()
 
const void * getInput ()
 
ma_err_t run (const ma_img_t *img)
 
ma_err_t setConfig (ma_model_cfg_opt_t opt,...) override
 
ma_err_t getConfig (ma_model_cfg_opt_t opt,...) override
 
- Public Member Functions inherited from ma::Model
 Model (Engine *engine, const char *name, uint16_t type)
 
virtual ~Model ()
 
const ma_perf_t getPerf () const
 
const char * getName () const
 
ma_model_type_t getType () const
 
ma_input_type_t getInputType () const
 
ma_output_type_t getOutputType () const
 
void setPreprocessDone (std::function< void(void *)> func)
 
void setPostprocessDone (std::function< void(void *)> func)
 
void setRunDone (std::function< void(void *)> func)
 
void setUserCtx (void *ctx)
 

Static Public Member Functions

static bool isValid (Engine *engine)
 

Protected Member Functions

ma_err_t preprocess () override
 
ma_err_t postprocess () override
 
- Protected Member Functions inherited from ma::Model
ma_err_t underlyingRun ()
 

Protected Attributes

ma_tensor_t input_
 
ma_tensor_t output_
 
ma_img_t img_
 
bool is_nhwc_
 
const ma_img_tinput_img_
 
double threshold_score_
 
std::forward_list< ma_class_tresults_
 
- Protected Attributes inherited from ma::Model
Enginep_engine_
 
const char * p_name_
 

Constructor & Destructor Documentation

◆ Classifier()

ma::model::Classifier::Classifier ( Engine engine)
Here is the call graph for this function:

◆ ~Classifier()

ma::model::Classifier::~Classifier ( )
virtual

Member Function Documentation

◆ getConfig()

ma_err_t ma::model::Classifier::getConfig ( ma_model_cfg_opt_t  opt,
  ... 
)
overridevirtual

Implements ma::Model.

◆ getInput()

const void * ma::model::Classifier::getInput ( )
virtual

Implements ma::Model.

◆ getResults()

const std::forward_list< ma_class_t > & ma::model::Classifier::getResults ( )

◆ isValid()

bool ma::model::Classifier::isValid ( Engine engine)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ postprocess()

ma_err_t ma::model::Classifier::postprocess ( )
overrideprotectedvirtual

Implements ma::Model.

◆ preprocess()

ma_err_t ma::model::Classifier::preprocess ( )
overrideprotectedvirtual

Implements ma::Model.

Here is the call graph for this function:

◆ run()

ma_err_t ma::model::Classifier::run ( const ma_img_t img)
Here is the call graph for this function:

◆ setConfig()

ma_err_t ma::model::Classifier::setConfig ( ma_model_cfg_opt_t  opt,
  ... 
)
overridevirtual

Implements ma::Model.

Member Data Documentation

◆ img_

ma_img_t ma::model::Classifier::img_
protected

◆ input_

ma_tensor_t ma::model::Classifier::input_
protected

◆ input_img_

const ma_img_t* ma::model::Classifier::input_img_
protected

◆ is_nhwc_

bool ma::model::Classifier::is_nhwc_
protected

◆ output_

ma_tensor_t ma::model::Classifier::output_
protected

◆ results_

std::forward_list<ma_class_t> ma::model::Classifier::results_
protected

◆ threshold_score_

double ma::model::Classifier::threshold_score_
protected