在Yolov5 Yolov4 Yolov3 TensorRT 实现Implementation

news: yolov5 support

引论

该项目是nvidia官方yolo-tensorrt的封装实现。你必须有经过训练的yolo模型(.weights)和来自darknet(yolov3&yolov4)的.cfg文件。对于yolov5,需要Pythorch中的模型文件(yolov5s.yaml)和经过训练的权重文件(yolov5s.pt)。

参考:https://github.com/enazoe/yolo-tensorrt

  • yolov5s , yolov5m , yolov5l , yolov5x tutorial
  • yolov4 , yolov4-tiny
  • yolov3 , yolov3-tiny

Features

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

PLATFORM & BENCHMARK

  • windows 10
  • ubuntu 18.04
  • L4T (Jetson platform)

BENCHMARK

x86 (inference time)

model

size

gpu

fp32

fp16

INT8

yolov5s

640x640

1080ti

8ms

/

7ms

yolov5m

640x640

1080ti

13ms

/

11ms

yolov5l

640x640

1080ti

20ms

/

15ms

yolov5x

640x640

1080ti

30ms

/

23ms

Jetson NX with Jetpack4.4.1 (inference / detect time)

model

size

gpu

fp32

fp16

INT8

yolov3

416x416

nx

105ms/120ms

30ms/48ms

20ms/35ms

yolov3-tiny

416x416

nx

14ms/23ms

8ms/15ms

12ms/19ms

yolov4-tiny

416x416

nx

13ms/23ms

7ms/16ms

7ms/15ms

yolov4

416x416

nx

111ms/125ms

55ms/65ms

47ms/57ms

yolov5s

416x416

nx

47ms/88ms

33ms/74ms

28ms/64ms

yolov5m

416x416

nx

110ms/145ms

63ms/101ms

49ms/91ms

yolov5l

416x416

nx

205ms/242ms

95ms/123ms

76ms/118ms

yolov5x

416x416

nx

351ms/405ms

151ms/183ms

114ms/149ms

ubuntu

model

size

gpu

fp32

fp16

INT8

yolov4

416x416

titanv

11ms/17ms

8ms/15ms

7ms/14ms

yolov5s

416x416

titanv

7ms/22ms

5ms/20ms

5ms/18ms

yolov5m

416x416

titanv

9ms/23ms

8ms/22ms

7ms/21ms

yolov5l

416x416

titanv

17ms/28ms

11ms/23ms

11ms/24ms

yolov5x

416x416

titanv

25ms/40ms

15ms/27ms

15ms/27ms

WRAPPER

Prepare the pretrained .weights and .cfg model.

Detector detector;

Config config;

std::vector<BatchResult> res;

detector.detect(vec_image, res)

Build and use yolo-trt as DLL or SO libraries

windows10

  • dependency : TensorRT 7.1.3.4 , cuda 11.0 , cudnn 8.0 , opencv4 , vs2015
  • build:

open MSVC sln/sln.sln file

    • dll project : the trt yolo detector dll
    • demo project : test of the dll

ubuntu & L4T (jetson)

The project generate the libdetector.so lib, and the sample code. If you want to use the libdetector.so lib in your own project,this cmake file perhaps could help you .

git clone https://github.com/enazoe/yolo-tensorrt.git
cd yolo-tensorrt/
mkdir build
cd build/
cmake ..
make
./yolo-trt

API

struct Config
{
        std::string file_model_cfg = "configs/yolov4.cfg";
 
        std::string file_model_weights = "configs/yolov4.weights";
 
        float detect_thresh = 0.9;
 
        ModelType net_type = YOLOV4;
 
        Precision inference_precison = INT8;
        
        int gpu_id = 0;
 
        std::string calibration_image_list_file_txt = "configs/calibration_images.txt";
 
};
 
class API Detector
{
public:
        explicit Detector();
        ~Detector();
 
        void init(const Config &config);
 
        void detect(const std::vector<cv::Mat> &mat_image,std::vector<BatchResult> &vec_batch_result);
 
private:
        Detector(const Detector &);
        const Detector &operator =(const Detector &);
        class Impl;
        Impl *_impl;
};

REFERENCE

在Yolov5 Yolov4 Yolov3 TensorRT 实现Implementation的更多相关文章

  1. YOLOv4:目标检测(windows和Linux下Darknet 版本)实施

    YOLOv4:目标检测(windows和Linux下Darknet 版本)实施 YOLOv4 - Neural Networks for Object Detection (Windows and L ...

  2. 八分音符(频率)卷积算子 Octave Convolution

    为什么读此系列文章? 优化数学和计算理论帮助机器学习完成问题分类: 1)按照领域划分,比如计算机视觉,自然语言处理,统计分析预测形: 2)按照算法复杂划分,比如是否是NP-Hard问题,是否需要精确解 ...

  3. tensorflow-yolov4实施方法

    tensorflow-yolov4实施方法 tensorflow-yolov4-tflite YOLOv4: Optimal Speed and Accuracy of Object Detectio ...

  4. object detection 总结

    1.基础 自己对于YOLOV1,2,3都比较熟悉. RCNN也比较熟悉.这个是自己目前掌握的基础2.第一步 看一下2019年的井喷的anchor free的网络3.第二步 看一下以往,引用多的网路4. ...

  5. Yolov3&Yolov4网络结构与源码分析

    Yolov3&Yolov4网络结构与源码分析 从2018年Yolov3年提出的两年后,在原作者声名放弃更新Yolo算法后,俄罗斯的Alexey大神扛起了Yolov4的大旗. 文章目录 1. 论 ...

  6. 【YOLOv5】手把手教你使用LabVIEW ONNX Runtime部署 TensorRT加速,实现YOLOv5实时物体识别(含源码)

    前言 上一篇博客给大家介绍了LabVIEW开放神经网络交互工具包[ONNX],今天我们就一起来看一下如何使用LabVIEW开放神经网络交互工具包实现TensorRT加速YOLOv5. 以下是YOLOv ...

  7. YOLOv3和YOLOv4长篇核心综述(下)

    YOLOv3和YOLOv4长篇核心综述(下) 4.3.3 Neck创新 在目标检测领域,为了更好的提取融合特征,通常在Backbone和输出层,会插入一些层,这个部分称为Neck.相当于目标检测网络的 ...

  8. YOLOv3和YOLOv4长篇核心综述(上)

    YOLOv3和YOLOv4长篇核心综述(上) 对目标检测算法会经常使用和关注,比如Yolov3.Yolov4算法. 实际项目进行目标检测任务,比如人脸识别.多目标追踪.REID.客流统计等项目.因此目 ...

  9. YOLOv4没交棒,但YOLOv5来了!

    YOLOv4没交棒,但YOLOv5来了! 前言 4月24日,YOLOv4来了! 5月30日,"YOLOv5"来了! 这里的 "YOLOv5" 是带有引号的,因为 ...

随机推荐

  1. 基于C++简单Windows API的socket编程(阻塞模式)

    1. 概述:简单的基于Windows API的socket点对点聊天程序,为了方便初学者,本文代码均采用阻塞原理编写. 2. 代码样例 Server.cpp(服务端) #include <cst ...

  2. Python 爬虫之Scrapy框架

    Scrapy框架架构 Scrapy框架介绍: 写一个爬虫,需要做很多的事情.比如:发送网络请求.数据解析.数据存储.反反爬虫机制(更换ip代理.设置请求头等).异步请求等.这些工作如果每次都要自己从零 ...

  3. Windows PE变形练手2-开发一套自己的PE嵌入模板

    PE嵌入模板 编写一段代码,生成一个已经处理过重定位信息,同时所有的内容都在代码段里,并且没有导入表的PE程序,把这个程序嵌入到其他PE的相关位置,能够独立的运行,接下来是整理了2个模板,一个是Hel ...

  4. Swift系列五 - 可选项

    可选项,一般也叫可选类型,它允许将值设为nil. 一.定义可选项 平时开发中,如果我们需要把一个变量置空时只需要把变量赋值一个nil即可: 上面尝试后不行,那怎么把一个变量置空呢? 答案:把变量设置可 ...

  5. 一文解决MySQL时区相关问题

    前言: 在使用MySQL的过程中,你可能会遇到时区相关问题,比如说时间显示错误.时区不是东八区.程序取得的时间和数据库存储的时间不一致等等问题.其实,这些问题都与数据库时区设置有关,本篇文章将从数据库 ...

  6. libminipng,压缩png的swift-framework

    libminipng 通过lodepng解析png图片,使用pngquant算法进行压缩的swift-framework 方法说明: /// 通过PNG图片Data压缩 /// /// - Param ...

  7. Linux 实验楼

    网络上的免费在线 Linux 实验系统 Wu Zhangjin 创作于 2014/01/12 打赏 by falcon of TinyLab.org 2014/01/12 这里收集各类可以直接在线访问 ...

  8. [笔记] 《c++ primer》书店程序 Chapter7

    Sales_data.h 1 #ifndef SALES_DATA_H 2 #define SALES_DATA_H 3 4 #include "Version_test.h" 5 ...

  9. linux服务之NTP及chrony时间同步

    博客园 首页 联系 管理   linux服务之NTP及chrony时间同步   一.NTP时间同步 NTP(Network Time Protocol,网络时间协议)是由RFC 1305定义的时间同步 ...

  10. AD命令获取计算机、用户相关信息

    1. 获取AD用户相关信息(用户名.创建日期.最后修改密码日期.最后登录日期) Get AD users, Name/Created Date/Last change passwd Date/Last ...