12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef EDK_SAMPLES_CLASSIFICATION_RUNNER_H_
- #define EDK_SAMPLES_CLASSIFICATION_RUNNER_H_
- #include <memory>
- #include <string>
- #include "cnosd.h"
- #include "cnpostproc.h"
- #include "device/mlu_context.h"
- #include "easybang/resize_and_colorcvt.h"
- #include "easyinfer/easy_infer.h"
- #include "easyinfer/mlu_memory_op.h"
- #include "easyinfer/model_loader.h"
- #include "runner.h"
- class ClassificationRunner : public StreamRunner {
- public:
- ClassificationRunner(const std::string& model_path, const std::string& func_name, const std::string& label_path,
- const std::string& data_path, bool show, bool save_video);
- ~ClassificationRunner();
- void Process(edk::CnFrame frame) override;
- private:
- edk::MluMemoryOp mem_op_;
- edk::EasyInfer infer_;
- edk::MluResizeConvertOp rc_op_;
- CnOsd osd_;
- std::shared_ptr<edk::ModelLoader> model_{nullptr};
- std::unique_ptr<edk::CnPostproc> postproc_{nullptr};
- std::unique_ptr<cv::VideoWriter> video_writer_{nullptr};
- void **mlu_output_{nullptr}, **cpu_output_{nullptr}, **mlu_input_{nullptr};
- bool show_;
- bool save_video_;
- };
- #endif
|