You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
2.5 KiB

#error "This source file seems to be unused. 2026-02-20"
#ifndef __IM_DNNWORKER_H_INCL__
#define __IM_DNNWORKER_H_INCL__
#include "../../lib/components/base/basicThread.h"
#include "../../lib/components/base/basicMutex.h"
#include "../../lib/components/base/basicSettingsProvider.h"
//#include "../../lib/components/base/basicEventHeap.h"
#include "../../lib/App/common/imageParser.h"
#define DARKNET
//#define GPU
#ifdef DARKNET
#ifndef GPU
#define DIRECT_DARKNET
#endif
#ifdef DIRECT_DARKNET
//#include <darknet/darknet.h>
#include "../../lib/data/darknet/darknetWraper.h"
#endif
//#include <darknet/yolo_v2_class.hpp>
#endif
#ifdef GPU
#undef GPU
#endif
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/dnn/dnn.hpp>
using namespace cv;
/**
* TODO: Add class description
*
* @author Gagua
*/
class IM_DnnWorker : public basicThread {
private:
#ifdef DARKNET
#ifndef DIRECT_DARKNET
Detector * m_pDarknetDetector;
#else
darknetWraper * m_pDarknetWraper;
#endif
#else
#endif
basicLogCollection * m_pLog;
config_setting_t * m_pSettings;
cv::dnn::Backend m_eBackendEngine;
cv::dnn::Target m_eTargetDevice;
cv::dnn::Net m_net;
cv::Mat m_oWorkingMat;
float m_fDetectionProbability;
bool m_bUseClassMapping;
std::vector<uint32_t> m_vClassesMap;
basicEventHeap * m_pEvtHeap;
char m_pPicturesBase[1024];
char m_pConfigPath[1024];
char m_pWeightsPath[1024];
basicMutex m_mBufferProtectorMutex;
IM_JOB * m_pActiveJob;
bool m_bDataIsActive;
IM_RESULT * m_fImageAnalyzer( Mat &Picture );
protected:
virtual void m_fThreadProc( void );//getLayerNames()
public:
// Constructor
explicit IM_DnnWorker( config_setting_t * Settings = NULL );
// Destructor
virtual ~IM_DnnWorker();
bool create( void );
bool enqueueJob( IM_JOB *ptr );
};
#endif // __IM_DNNWORKER_H_INCL__