// YOLOV8检测器 #ifndef __DETECTOR_YOLOV8_H__ #define __DETECTOR_YOLOV8_H__ #include #include #include #include #include "Decoder.h" using namespace std; using namespace cv; using namespace migraphx; namespace migraphxSamples { // YOLOV8参数 typedef struct _YOLOV8Parameter { int numberOfClasses;// 类别数 float confidenceThreshold;// 置信度阈值 float nmsThreshold;// NMS阈值 // float objectThreshold;//目标置信度值 }YOLOV8Parameter; class DetectorYOLOV8 { public: DetectorYOLOV8(); ~DetectorYOLOV8(); 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; YOLOV8Parameter yolov8Parameter; migraphx::parameter_map ParameterMap; }; } #endif