yolov8_obb.h 829 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include<iostream>
  3. #include<opencv2/opencv.hpp>
  4. #include "yolov8_utils.h"
  5. class Yolov8Obb {
  6. public:
  7. Yolov8Obb() {
  8. }
  9. ~Yolov8Obb() {}
  10. bool ReadModel(cv::dnn::Net& net, std::string& netPath, bool isCuda);
  11. bool Detect(cv::Mat& srcImg, cv::dnn::Net& net, std::vector<OutputParams>& output);
  12. int _netWidth = 1024; //ONNX图片输入宽度
  13. int _netHeight = 1024; //ONNX图片输入高度
  14. //类别名,自己的模型需要修改此项
  15. std::vector<std::string> _className =
  16. { "plane", "ship", "storage tank",
  17. "baseball diamond", "tennis court", "basketball court",
  18. "ground track field", "harbor", "bridge",
  19. "large vehicle", "small vehicle", "helicopter",
  20. "roundabout", "soccer ball field", "swimming pool"
  21. };
  22. private:
  23. float _classThreshold = 0.25;
  24. float _nmsThreshold = 0.45;
  25. };