NanoDetector.h 736 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "IObjectDetector.h"
  3. #include <opencv2/opencv.hpp>
  4. class CNanoDetector :public IObjectDetector
  5. {
  6. public:
  7. CNanoDetector(const char* strModelPath, int iBatchSize = 1, int iInferMode = 0, int iDeviceIndex = 0);
  8. virtual ~CNanoDetector();
  9. //初始化对象
  10. virtual bool Init();
  11. //释放对象
  12. virtual bool UnInit();
  13. //获取对象名
  14. virtual const char* GetType();
  15. //执行infer
  16. virtual bool Execute(cv::Mat& inputImage);
  17. //获取结果
  18. virtual bool GetResults(std::vector<DetectorResult>& vecDetectorResults);
  19. private:
  20. bool m_bInit;
  21. int m_iBatchSize;
  22. int m_iInferMode;
  23. int m_iDeviceInedx;
  24. std::string m_strModelFile;
  25. void* m_pInfer;
  26. std::vector<DetectorResult> m_vecDetectResult;
  27. };