在Yolov5 Yolov4 Yolov3 TensorRT 实现Implementation
在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
- https://github.com/wang-xinyu/tensorrtx/tree/master/yolov4
- https://github.com/mj8ac/trt-yolo-app_win64
- https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps
在Yolov5 Yolov4 Yolov3 TensorRT 实现Implementation的更多相关文章
- YOLOv4:目标检测(windows和Linux下Darknet 版本)实施
YOLOv4:目标检测(windows和Linux下Darknet 版本)实施 YOLOv4 - Neural Networks for Object Detection (Windows and L ...
- 八分音符(频率)卷积算子 Octave Convolution
为什么读此系列文章? 优化数学和计算理论帮助机器学习完成问题分类: 1)按照领域划分,比如计算机视觉,自然语言处理,统计分析预测形: 2)按照算法复杂划分,比如是否是NP-Hard问题,是否需要精确解 ...
- tensorflow-yolov4实施方法
tensorflow-yolov4实施方法 tensorflow-yolov4-tflite YOLOv4: Optimal Speed and Accuracy of Object Detectio ...
- object detection 总结
1.基础 自己对于YOLOV1,2,3都比较熟悉. RCNN也比较熟悉.这个是自己目前掌握的基础2.第一步 看一下2019年的井喷的anchor free的网络3.第二步 看一下以往,引用多的网路4. ...
- Yolov3&Yolov4网络结构与源码分析
Yolov3&Yolov4网络结构与源码分析 从2018年Yolov3年提出的两年后,在原作者声名放弃更新Yolo算法后,俄罗斯的Alexey大神扛起了Yolov4的大旗. 文章目录 1. 论 ...
- 【YOLOv5】手把手教你使用LabVIEW ONNX Runtime部署 TensorRT加速,实现YOLOv5实时物体识别(含源码)
前言 上一篇博客给大家介绍了LabVIEW开放神经网络交互工具包[ONNX],今天我们就一起来看一下如何使用LabVIEW开放神经网络交互工具包实现TensorRT加速YOLOv5. 以下是YOLOv ...
- YOLOv3和YOLOv4长篇核心综述(下)
YOLOv3和YOLOv4长篇核心综述(下) 4.3.3 Neck创新 在目标检测领域,为了更好的提取融合特征,通常在Backbone和输出层,会插入一些层,这个部分称为Neck.相当于目标检测网络的 ...
- YOLOv3和YOLOv4长篇核心综述(上)
YOLOv3和YOLOv4长篇核心综述(上) 对目标检测算法会经常使用和关注,比如Yolov3.Yolov4算法. 实际项目进行目标检测任务,比如人脸识别.多目标追踪.REID.客流统计等项目.因此目 ...
- YOLOv4没交棒,但YOLOv5来了!
YOLOv4没交棒,但YOLOv5来了! 前言 4月24日,YOLOv4来了! 5月30日,"YOLOv5"来了! 这里的 "YOLOv5" 是带有引号的,因为 ...
随机推荐
- Docker学习笔记---通俗易懂
目录 Docker 简介 Docker安装 Docker的基本组成 安装Docker 配置阿里云镜像加速 回顾helloworld流程 工作原理 Docker的常用命令 帮助命令 镜像命令 容器命令 ...
- DVWA之 SQL Injection(Blind)
SQL Injection(Blind) SQL Injection(Blind),即SQL盲注,与一般注入的区别在于,一般的注入攻击者可以直接从页面上看到注入语句的执行结果,而盲注时攻击者通常是无法 ...
- hdu5056(找相同字母不出现k次的子串个数)
题意: 给你一个字符串,然后问你这个字符串里面有多少个满足要求的子串,要求是每个子串相同字母出现的次数不能超过k. 思路: 这种题目做着比较有意思,而且不是很难(但自己还是嘚瑟,w ...
- Python中Selenium模块的使用
目录 Selenium的介绍.配置和调用 Selenium的配置 Selenium的调用 Selenium的使用 定位 定位元素的使用 定位下拉标签元素 在iframe框架之间切换 上传文件 Webd ...
- XCTF-mfw
mfw mfw是什么东西??? 看题: 进来只有几个标签,挨着点一遍,到About页面 看到了Git,猜测有git泄露,访问/.git/HEAD成功 上Githack,但是会一直重复 按了一次ctrl ...
- SpringBoot整合JWT
JWT (整合SpringBoot) 1. 引入依赖 <!-- 引入JWT --> <dependency> <groupId>com.auth0</grou ...
- PHP 通用格式化调试函数
/** * 打印调试函数 * @param $content * @param $is_die */function pre($content, $is_die = true){ header('Co ...
- [源码解析] 并行分布式任务队列 Celery 之 EventDispatcher & Event 组件
[源码解析] 并行分布式任务队列 Celery 之 EventDispatcher & Event 组件 目录 [源码解析] 并行分布式任务队列 Celery 之 EventDispatche ...
- HashMap底层原理分析
本文将从以下方面结合源码进行分析:自动扩容.初始化与懒加载.哈希计算.位运算(默认采用JDK1.8). 自动扩容 扩容操作发生在putVal最后部分,在增加元素后才判断是否需要扩容,如果超过阈值, ...
- 简单聊聊VisualStudio的断点调试
这节聊聊如何使用VisualStudio进行断点调试. 在debug过程中,我们有时需要查看程序在运行到某一行代码时,上下文中的变量或者一些其他的数据是什么样的,我们就要设置断点(Breakpoint ...