#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& media, fDetCallback callback, void* ctx); virtual TZ_INT SetDetectCfg(const std::string& param); private: virtual void Entry(); void skipFrame(SPtr& media, fDetCallback callback, void* ctx); void draw(YoloCrowdDetectResult& yoloCrowdRst, DrawInfo& draw, TZ_INT height, TZ_INT width); TargetInfo m_targets; std::list, 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