123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef __YOLOCROWDDETECTOR_H
- #define __YOLOCROWDDETECTOR_H
- #include "Detector.h"
- #include "YoloCrowdApp.h"
- #include "YoloCrowdCfg.h"
- NAMESPACE_MAS_BEGIN
- NAMESPACE_YOLOCROWD_BEGIN
- class YoloCrowdDetector : public Detector, public tzc::OSThread {
- public:
- YoloCrowdDetector(const std::string& key, const std::string& name);
- ~YoloCrowdDetector();
- virtual TZ_INT Initialize(const std::string& initParam);
- virtual TZ_INT Dispose();
- virtual TZ_INT TurnOnGPU();
- virtual TZ_INT TurnOffGPU();
- virtual TZ_INT DoDetect(SPtr<StreamInfo>& media, fDetCallback callback, void* ctx);
- virtual TZ_INT SetDetectCfg(const std::string& param);
- private:
- virtual void Entry();
- void skipFrame(SPtr<StreamInfo>& media, fDetCallback callback, void* ctx);
- void draw(YoloCrowdDetectResult& yoloCrowdRst, DrawInfo& draw, TZ_INT height, TZ_INT width);
- TargetInfo m_targets;
- std::list<std::tuple<SPtr<StreamInfo>, fDetCallback, void*>> m_waitList;
- YoloCrowdApp* m_yoloCrowd;
- tzc::Mutex m_cntLock;
- tzc::Mutex m_listLock;
- tzc::Mutex m_rstLock;
- tzc::Semaphore m_sema;
- const TZ_Uint32 MAX_WAIT_LIST_LEN = 5;
- const TZ_Uint32 YOLO_WAIT_MSECOND = 100;
- };
- NAMESPACE_YOLOCROWD_END
- NAMESPACE_MAS_END
- #endif
|