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视觉网奇

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

暂无评论

发表评论

相关推荐