tensorrt yolov5学习笔记

多张图片预测:

https://github.com/noahmr/yolov5-tensorrt

 https://github.com/noahmr/yolov5-tensorrt/blob/main/src/yolov5_detector.cpp

Result Detector::detectBatch(const std::vector<cv::cuda::GpuMat>& images, 
                    std::vector<std::vector<Detection>>* out,
                    int flags) noexcept

下载后:

yolov5-tensorrt-main.zip

本地项目:yolov5-5.0_voc

很感谢这个作者:

GitHub - enazoe/yolo-tensorrt: TensorRT8.Support Yolov5n,s,m,l,x .darknet -> tensorrt. Yolov4 Yolov3 use raw darknet *.weights and *.cfg fils. If the wrapper is useful to you,please Star it.

https://github.com/enazoe/yolo-tensorrt/blob/c4d72605f83d547081cc30c3b71458001826191d/modules/class_yolo_detector.hpp

cv::Mat trtInput = blobFromDsImages(vec_ds_images, _p_net->getInputH(),_p_net->getInputW());

yolov5-v6:

  • inequal net width and height
  •  batch inference
  •  support FP32,FP16,INT8

下载后:yolo-tensorrt-TRT8.zip

入口:

https://github.com/enazoe/yolo-tensorrt/blob/c4d72605f83d547081cc30c3b71458001826191d/samples/sample_detector.cpp

完整调试博客:

yolov5转tensorrt c++_jacke121的专栏-CSDN博客

https://github.com/OpenJetson/tensorrt-yolov5/blob/main/yolov5.cpp

for循环添加数据

static float data[BATCH_SIZE * 3 * INPUT_H * INPUT_W];

cudaMemcpy 效率不高:

https://github.com/Wulingtian/yolov5_tensorrt_int8/blob/master/yolov5s_infer.cc

版权声明:本文为CSDN博主「AI视觉网奇」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jacke121/article/details/121851414

AI视觉网奇

我还没有学会写个人说明!

暂无评论

发表评论

相关推荐

YOLO-V3-SPP详细解析

YOLO-V3-SPP 继前两篇简单的YOLO博文 YOLO-V1 论文理解《You Only Look Once: Unified, Real-Time Object Detection》YOLO-V2论文理解《YOLO9000: Bet

目标检测部署(卡牌识别)

最近在折腾yolov5,训练了一个识别纸牌的模型,最后使用onnxruntime进行部署,感兴趣的可以上github上clone下来玩玩,模型的权重文件上传到了百度网盘,链接

Yolo(3)(项目)Yolo v3 目标检测(85分类)

目录 基础理论 一、 读取文件 二、神经网络初始化 1、搭建神经网络 2、GPU加速 三、打开摄像头、按帧读取图像 四、向神经网络输入 五、获取神经网络输出 1、获取各层名称 2、获取输出层名称 3、获取输出层图像&#xff