We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fef5f0 commit 4686140Copy full SHA for 4686140
yolov5/common.hpp
@@ -12,7 +12,7 @@
12
using namespace nvinfer1;
13
14
cv::Rect get_rect(cv::Mat& img, float bbox[4]) {
15
- int l, r, t, b;
+ float l, r, t, b;
16
float r_w = Yolo::INPUT_W / (img.cols * 1.0);
17
float r_h = Yolo::INPUT_H / (img.rows * 1.0);
18
if (r_h > r_w) {
@@ -34,7 +34,7 @@ cv::Rect get_rect(cv::Mat& img, float bbox[4]) {
34
t = t / r_h;
35
b = b / r_h;
36
}
37
- return cv::Rect(l, t, r - l, b - t);
+ return cv::Rect(round(l), round(t), round(r - l), round(b - t));
38
39
40
float iou(float lbox[4], float rbox[4]) {
0 commit comments