YoloCrowdApp.h 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __YOLOCROWDAPP_H
  2. #define __YOLOCROWDAPP_H
  3. #include "yolocrowd.hpp"
  4. #include "YoloCrowdCfg.h"
  5. #include "Locks.h"
  6. #include "ExHeaders.h"
  7. NAMESPACE_MAS_BEGIN
  8. NAMESPACE_YOLOCROWD_BEGIN
  9. class YoloCrowdApp {
  10. public:
  11. static YoloCrowdApp* Instance();
  12. static void DestroyInstance();
  13. TZ_INT Initialize(const std::string& initParam);
  14. TZ_INT Dispose();
  15. TZ_INT DoDetect(cv::Mat& input,
  16. TargetInfo& targets,
  17. std::vector<int>& objClass,
  18. std::vector<std::vector<float>>& objPos);
  19. private:
  20. YoloCrowdApp();
  21. ~YoloCrowdApp();
  22. void warmup();
  23. TZ_BOOL m_inited;
  24. TZ_INT m_usecnt;
  25. TZ_INT m_gpuid;
  26. TZ_INT m_maxObjects;
  27. TZ_DOUBLE m_confidenceThreshold;
  28. TZ_DOUBLE m_NMSThreshold;
  29. std::string m_modelPath;
  30. SPtr<YoloCrowd::Infer> m_engine;
  31. static tzc::Mutex _mutex;
  32. static YoloCrowdApp* _instance;
  33. };
  34. NAMESPACE_YOLOCROWD_END
  35. NAMESPACE_MAS_END
  36. #endif