在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. Linux启动流程和服务管理(init和systemd)

    目录 一:Linux启动流程 init和Systemd的区别 二:Linux服务管理(service,systemctl) 一:Linux启动流程 Rhel6启动过程: Rhel7启动过程: GRUB ...

  2. TCP的三次握手和四次挥手和UDP协议

    目录 TCP 三次握手 四次挥手 为什么建立连接是三次而断开连接是四次呢? TCP和UDP的区别 TCP数据包的封装 UDP数据包封装 SCTP SYN Flood泛洪攻击 TCP TCP(Trans ...

  3. Windows核心编程 第七章 线程的调度、优先级和亲缘性(上)

    第7章 线程的调度.优先级和亲缘性 抢占式操作系统必须使用某种算法来确定哪些线程应该在何时调度和运行多长时间.本章将要介绍Microsoft Windows 98和Windows 2000使用的一些算 ...

  4. 如何解决异步接口请求快慢不均导致的数据错误问题? - DevUI

    DevUI 是一款面向企业中后台产品的开源前端解决方案,它倡导沉浸.灵活.至简的设计价值观,提倡设计者为真实的需求服务,为多数人的设计,拒绝哗众取宠.取悦眼球的设计.如果你正在开发 ToB 的工具类产 ...

  5. ElasticSearch7.10.0入门学习

    ElasticSearch完成最关键的一个功能就是 大数据搜索 官网:https://www.elastic.co/cn/elasticsearch/ 简介 Elasticsearch 是一个分布式全 ...

  6. Linux基本内容

    当你学会开发完成一个项目之后,你就可以将项目进行上线,而且其实并不难,你需要先对Linux操作系统了解一下,博客下面的内容是基于CentOs7服务器. 购买服务器 参考链接 Linux宝塔面板 Lin ...

  7. Azure Storage 利用 azCopy 复制迁移数据

    一,引言 前两天遇到了Azure Blob Storage 需要迁移到另外的一个 Azure Blob Storage 中.手动下载.上传已经无法满足了,得另寻一种方式了 AzCopy.Azure 为 ...

  8. 在Visual Studio 中使用git——文件管理-中(五)

    在Visual Studio 中使用git--什么是Git(一) 在Visual Studio 中使用git--给Visual Studio安装 git插件(二) 在Visual Studio 中使用 ...

  9. Django(19)QuerySet API

    前言 我们通常做查询操作的时候,都是通过模型名字.objects的方式进行操作.其实模型名字.objects是一个django.db.models.manager.Manager对象,而Manager ...

  10. 判断标准I/O的缓冲区类型

    #include <stdio.h> void pr_stdio(const char *, FILE *); int main() { FILE *fp; fputs("ent ...