fix yolo network occasinally preditcting a match out side of image bounds
This commit is contained in:
17
yolo.h
17
yolo.h
@ -27,19 +27,16 @@ private:
|
||||
static constexpr float modelScoreThreshold = 0.45;
|
||||
static constexpr float modelNMSThreshold = 0.50;
|
||||
|
||||
std::string modelPath;
|
||||
std::vector<std::pair<std::string, int>> classes;
|
||||
cv::Size2f modelShape;
|
||||
bool letterBoxForSquare = true;
|
||||
cv::dnn::Net net;
|
||||
|
||||
void loadClasses(const std::string& classes);
|
||||
void loadOnnxNetwork(const std::filesystem::path& path);
|
||||
cv::Mat formatToSquare(const cv::Mat &source);
|
||||
|
||||
std::string modelPath;
|
||||
|
||||
std::vector<std::pair<std::string, int>> classes;
|
||||
|
||||
cv::Size2f modelShape;
|
||||
|
||||
bool letterBoxForSquare = true;
|
||||
|
||||
cv::dnn::Net net;
|
||||
static void clampBox(cv::Rect& box, const cv::Size& size);
|
||||
|
||||
public:
|
||||
Yolo(const std::filesystem::path &onnxModelPath = "", const cv::Size& modelInputShape = {640, 480},
|
||||
|
Reference in New Issue
Block a user