// YOLOV7检测器 #ifndef __DETECTOR_YOLOV7_H__ #define __DETECTOR_YOLOV7_H__ #include #include #include #include #include "Decoder.h" using namespace std; using namespace cv; using namespace migraphx; namespace migraphxSamples { // YOLOV7参数 typedef struct _YOLOV7Parameter { int numberOfClasses;// 类别数 float confidenceThreshold;// 置信度阈值 float nmsThreshold;// NMS阈值 float objectThreshold;//目标置信度值 }YOLOV7Parameter; class DetectorYOLOV7 { public: DetectorYOLOV7(); ~DetectorYOLOV7(); ErrorCode Initialize(InitializationParameterOfDetector initializationParameterOfDetector); ErrorCode Detect(const cv::Mat &srcImage, std::vector &resultsOfDetection); ErrorCode Detect(DCU_Frame &srcImage, std::vector &resultsOfDetection); float* preprocess_Image = NULL; private: ErrorCode DoCommonInitialization(InitializationParameterOfDetector initializationParameterOfDetector); private: cv::FileStorage configurationFile; InitializationParameterOfDetector initializationParameter; FILE *logFile; // net migraphx::program net; cv::Size inputSize; string inputName; migraphx::shape inputShape; bool useFP16; vector classNames; YOLOV7Parameter yolov7Parameter; migraphx::parameter_map ParameterMap; }; } #endif