Comments (2)
用最终drow_bbox里面的结果是否就可以?
tensorrtx/yolov5/yolov5_det.cpp
Line 204 in 62050de
参考下drow_bbox里面get_rect的实现
tensorrtx/yolov5/src/postprocess.cpp
Line 87 in 62050de
from tensorrtx.
`std::tuple<float, float, float, float> get_rect_values(cv::Mat& img, float bbox[4]) {
float l, r, t, b;
float r_w = kInputW / (img.cols * 1.0);
float r_h = kInputH / (img.rows * 1.0);
if (r_h > r_w) {
l = bbox[0] - bbox[2] / 2.f;
r = bbox[0] + bbox[2] / 2.f;
t = bbox[1] - bbox[3] / 2.f - (kInputH - r_w * img.rows) / 2;
b = bbox[1] + bbox[3] / 2.f - (kInputH - r_w * img.rows) / 2;
l = l / r_w;
r = r / r_w;
t = t / r_w;
b = b / r_w;
} else {
l = bbox[0] - bbox[2] / 2.f - (kInputW - r_h * img.cols) / 2;
r = bbox[0] + bbox[2] / 2.f - (kInputW - r_h * img.cols) / 2;
t = bbox[1] - bbox[3] / 2.f;
b = bbox[1] + bbox[3] / 2.f;
l = l / r_h;
r = r / r_h;
t = t / r_h;
b = b / r_h;
}
return std::make_tuple(l, t, r - l, b - t);
}`
谢谢大佬!这个函数返回了bbox在原图上的xywh。
from tensorrtx.
Related Issues (20)
- 有计划支持yoloworld吗? HOT 1
- Yolov8 想将激活函数修改为relu,但是发现代码写死了,yolov5使用的auto更具有通用性 HOT 1
- yolov5 nms支持CUDA加速 HOT 5
- ImportError: libnvinfer.so.8: cannot open shared object file: No such file or directory HOT 3
- cmake error HOT 1
- The recently updated YOLOv8-Pose does not come with dedicated code for converting to the .wts format. HOT 2
- yolov8-pose似乎 不支持自己训练的模型 HOT 7
- kernel weights has count 2688 but 32640 was expected HOT 1
- yolov5编译问题 HOT 2
- yolov5s.pt微调后在生成.wts报错,改了数据类别,但类别总数不变。麻烦大大帮忙看看~谢谢!!new.pt是我微调后的模型 HOT 1
- ModuleNotFoundError: No module named 'utils.torch_utils' HOT 2
- 博主你好,这个能部署到windows上面了吗 HOT 6
- win10 compile yolov8 happen:yololayer.cu(262): error : expression must have a constant value HOT 12
- 不使用cmake搭建环境 HOT 21
- yolov8-seg, output error HOT 18
- YOLOV8 Assertion `serialized_engine' failed. 使用自己的.pt 生成 .wts 是成功的,但转.engine 是报错。chat说是卷积层权重数量不匹配 HOT 1
- Unable to build engine file for Yolov7 Custom model
- How to use file yolov8_det_trt.py to check one's own model
- yolov5-7.0,about anchor
- 可以使用onnx模型转换为tensorrt模型,再进行推理吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorrtx.