SSCMA-Micro CPP SDK  v2.0.0
SSCMA-Micro is a cross-platform machine learning inference framework designed for embedded devices.
ma_model_classifier.h
Go to the documentation of this file.
1 #ifndef _MA_MODEL_CLASSIFIER_H
2 #define _MA_MODEL_CLASSIFIER_H
3 
4 #include <vector>
5 
6 #include "../cv/ma_cv.h"
7 
8 #include "ma_model_base.h"
9 
10 namespace ma::model {
11 
12 class Classifier : public Model {
13 protected:
17  bool is_nhwc_;
20  std::forward_list<ma_class_t> results_;
21 
22 protected:
23  ma_err_t preprocess() override;
24  ma_err_t postprocess() override;
25 
26 public:
27  Classifier(Engine* engine);
28  virtual ~Classifier();
29  static bool isValid(Engine* engine);
30  const std::forward_list<ma_class_t>& getResults();
31  const void *getInput();
32  ma_err_t run(const ma_img_t* img);
33  ma_err_t setConfig(ma_model_cfg_opt_t opt, ...) override;
34  ma_err_t getConfig(ma_model_cfg_opt_t opt, ...) override;
35 };
36 
37 } // namespace ma::model
38 
39 #endif // _MA_MODEL_DETECTOR_H
Definition: ma_model_base.h:14
Definition: ma_engine_base.h:17
Definition: ma_model_classifier.h:12
ma_err_t run(const ma_img_t *img)
Definition: ma_model_classifier.cpp:136
bool is_nhwc_
Definition: ma_model_classifier.h:17
const ma_img_t * input_img_
Definition: ma_model_classifier.h:18
std::forward_list< ma_class_t > results_
Definition: ma_model_classifier.h:20
static bool isValid(Engine *engine)
Definition: ma_model_classifier.cpp:34
virtual ~Classifier()
Definition: ma_model_classifier.cpp:32
const std::forward_list< ma_class_t > & getResults()
Definition: ma_model_classifier.cpp:128
ma_tensor_t input_
Definition: ma_model_classifier.h:14
ma_img_t img_
Definition: ma_model_classifier.h:16
const void * getInput()
Definition: ma_model_classifier.cpp:132
ma_err_t getConfig(ma_model_cfg_opt_t opt,...) override
Definition: ma_model_classifier.cpp:159
ma_err_t postprocess() override
Definition: ma_model_classifier.cpp:91
Classifier(Engine *engine)
Definition: ma_model_classifier.cpp:9
ma_tensor_t output_
Definition: ma_model_classifier.h:15
double threshold_score_
Definition: ma_model_classifier.h:19
ma_err_t setConfig(ma_model_cfg_opt_t opt,...) override
Definition: ma_model_classifier.cpp:143
ma_err_t preprocess() override
Definition: ma_model_classifier.cpp:70
ma_err_t
Definition: ma_types.h:21
ma_model_cfg_opt_t
Definition: ma_types.h:229
Definition: ma_model_classifier.cpp:5
Definition: ma_types.h:124
Definition: ma_types.h:74