tensorrt yolov5学习笔记

x33g5p2x  于2021-12-10 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(375)

多张图片预测:

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

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

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

下载后:

yolov5-tensorrt-main.zip

跟上面基本一样:

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

多图片预测2:

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

相关文章