diff --git a/csrc/end2end/yolov8.hpp b/csrc/end2end/yolov8.hpp index 7160805..b8e39c9 100644 --- a/csrc/end2end/yolov8.hpp +++ b/csrc/end2end/yolov8.hpp @@ -2,21 +2,9 @@ // Created by ubuntu on 1/8/23. // #include "detect_config.hpp" -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include "NvInfer.h" #include "NvInferPlugin.h" -#include "NvInferRuntimeCommon.h" static const int INPUT_W = 640; static const int INPUT_H = 640; @@ -129,8 +117,6 @@ const unsigned int COLORS[80][3] = { { 128, 128, 0 } }; - - struct Object { cv::Rect_ rect; @@ -150,8 +136,8 @@ public: void postprocess(std::vector& objs); size_t in_size = 1 * 3 * INPUT_W * INPUT_H; - float w; - float h; + float w = INPUT_W; + float h = INPUT_H; float ratio = 1.0f; float dw = 0.f; float dh = 0.f; @@ -272,8 +258,8 @@ void YOLOv8::make_pipe(bool warmup) void YOLOv8::copy_from_Mat(const cv::Mat& image) { - float height = image.rows; - float width = image.cols; + float height = (float)image.rows; + float width = (float)image.cols; float r = std::min(INPUT_H / height, INPUT_W / width);