TensorRT 基于Yolov3的开发

Models

Desc

tensorRT for Yolov3

https://github.com/lewes6369/TensorRT-Yolov3

Test Enviroments

Ubuntu  16.04

TensorRT 5.0.2.6/4.0.1.6

CUDA 9.2

下载官方模型转换的caffe模型:

百度云pwd:gbue

谷歌drive

如果运行模型是自己训练的,注释“upsample_param”块,并将最后一层的prototxt修改为:

Download the caffe model converted by official model:

Baidu Cloud here pwd: gbue

Google Drive here

If run model trained by yourself, comment the "upsample_param" blocks, and modify the prototxt the last layer as:

layer {

#the bottoms are the yolo input layers

bottom: "layer82-conv"

bottom: "layer94-conv"

bottom: "layer106-conv"

top: "yolo-det"

name: "yolo-det"

type: "Yolo"

}

如果不同的内核,还需要更改“YoloConfigs.h”中的yolo配置。

Run Sample

#build source code

git submodule update --init --recursive

mkdir build

cd build && cmake .. && make && make install

cd ..

#for yolov3-608

./install/runYolov3 --caffemodel=./yolov3_608.caffemodel --prototxt=./yolov3_608.prototxt --input=./test.jpg --W=608 --H=608 --class=80

#for fp16

./install/runYolov3 --caffemodel=./yolov3_608.caffemodel --prototxt=./yolov3_608.prototxt --input=./test.jpg --W=608 --H=608 --class=80 --mode=fp16

#for int8 with calibration datasets

./install/runYolov3 --caffemodel=./yolov3_608.caffemodel --prototxt=./yolov3_608.prototxt --input=./test.jpg --W=608 --H=608 --class=80 --mode=int8 --calib=./calib_sample.txt

#for yolov3-416 (need to modify include/YoloConfigs for YoloKernel)

./install/runYolov3 --caffemodel=./yolov3_416.caffemodel --prototxt=./yolov3_416.prototxt --input=./test.jpg --W=416 --H=416 --class=80

Desc

tensorRT for Yolov3

Test Enviroments

Ubuntu  16.04
TensorRT 5.0.2.6/4.0.1.6
CUDA 9.2

Performance

Eval Result

用appending附件编译上面的模型模型--evallist=labels.txt

从val2014中选择的200张图片制作的int8校准数据(见脚本目录)

提示注意:             

在yolo层和nms中,caffe的实现没有什么不同,应该与tensorRT fp32的结果相似。

Details About Wrapper

see
link TensorRTWrapper

https://github.com/lewes6369/tensorRTWrapper

TRTWrapper

Desc

a wrapper for tensorRT net (parser caffe)

Test Environments

Ubuntu  16.04
TensorRT 5.0.2.6/4.0.1.6
CUDA 9.2

About Wraper

you can use the wrapper like this:

//normal
std::vector<std::vector<float>> calibratorData;
trtNet net("vgg16.prototxt","vgg16.caffemodel",{"prob"},calibratorData);
//fp16
trtNet net_fp16("vgg16.prototxt","vgg16.caffemodel",{"prob"},calibratorData,RUN_MODE:FLOAT16);
//int8
trtNet net_int8("vgg16.prototxt","vgg16.caffemodel",{"prob"},calibratorData,RUN_MODE:INT8);
 
//run inference:
net.doInference(input_data.get(), outputData.get());
 
//can print time cost
net.printTime();
 
//can write to engine and load From engine
net.saveEngine("save_1.engine");
trtNet net2("save_1.engine");

when you need add new plugin ,just add the plugin code to pluginFactory

Run Sample

#for classification
cd sample
mkdir build
cd build && cmake .. && make && make install
cd ..
./install/runNet --caffemodel=${CAFFE_MODEL_NAME} --prototxt=${CAFFE_PROTOTXT} --input=./test.jpg

TensorRT 基于Yolov3的开发的更多相关文章

  1. TensorRT 7.2.1开发初步

    TensorRT 7.2.1开发初步 TensorRT 7.2.1开发人员指南演示了如何使用C ++和Python API来实现最常见的深度学习层.它显示了如何采用深度学习框架构建现有模型,并使用该模 ...

  2. TensorRT 7.2.1 开发概要(下)

    TensorRT 7.2.1 开发概要(下) 1.2. Where Does TensorRT Fit? 一般来说,开发和部署深度学习模型的工作流要经过三个阶段. Phase 1 is trainin ...

  3. TensorRT 7.2.1 开发概要(上)

    TensorRT 7.2.1 开发概要(上) Abstract 这个TysRR7.2.1开发者指南演示了如何使用C++和Python API来实现最常用的深层学习层.它展示了如何使用深度学习框架构建现 ...

  4. [Open Source]基于YOLOv3与Django框架的Web应用-YOLOv3_Detect_Web

    YOLOv3_Detect_Web Use Yolov3 detect on Web 使用 YOLOv3(PyTorch 和 Django 实现)的对象检测应用程序. 网页和 REST API由Dja ...

  5. 基于Laravel+Swoole开发智能家居后端

    基于Laravel+Swoole开发智能家居后端 在上一篇<Laravel如何优雅的使用Swoole>中我已经大概谈到了Laravel结合Swoole的用法. 今天,我参与的智能家居项目基 ...

  6. 优分享VR开源啦,优分享VR是基于Google VR开发的一款手机VR视频资源的聚合软件

    欢迎来到优分享VR开源项目 优分享VR 开源中国Git地址: http://git.oschina.net/xumingwang/youkes_vr 优分享VR是 优分享安卓APP VR视频播放开源部 ...

  7. SCADESuite嵌入式软件基于模型的开发

    SCADE Suite®产品是针对高安全性嵌入式软件的基于模型的开发环境 SCADE Suite是高安全性嵌入式软件的开发标准,其应用领域涵盖航空.国防.轨道交通.能源和重工业.专为最高等级的质量和安 ...

  8. 与众不同 windows phone (31) - Communication(通信)之基于 Socket UDP 开发一个多人聊天室

    原文:与众不同 windows phone (31) - Communication(通信)之基于 Socket UDP 开发一个多人聊天室 [索引页][源码下载] 与众不同 windows phon ...

  9. 与众不同 windows phone (30) - Communication(通信)之基于 Socket TCP 开发一个多人聊天室

    原文:与众不同 windows phone (30) - Communication(通信)之基于 Socket TCP 开发一个多人聊天室 [索引页][源码下载] 与众不同 windows phon ...

随机推荐

  1. 百度sitemap.xml

    <?xml version="1.0" encoding="UTF-8" ?> <urlset xmlns="http://www. ...

  2. 常用的STL

    map      容器和数组一样,不过比较活用,相当于直接离散化数组 map<int ,int>mp 一维int map<string ,string>mp 一维 str ma ...

  3. POJ 2762 单连通图

    题意:      给你一个有向图,问你这个图是不是单连通图,单连通就是任意两点之间至少存在一条可达路径. 思路:      先强连通所点,重新建图,此时的图不存在环,然后我们在看看是否存在一条路径可以 ...

  4. 华为USG6000V防火墙简单配置案例

    如图,PC1是企业内网用户,要通过防火墙NAT方式( 1.1.1.105-1.1.1.106 )访问Internet,Server是企业的FTP服务器,通过静态NAT方式供外网用户访问,对外的地址是1 ...

  5. 路由协议之RIP

    目录 RIP协议 RIP的路由汇总和过滤 RIP的认证 RIP的防环机制 华为/思科中的配置 RIP协议 RIP协议是一种内部网关协议(IGP),底层是贝尔曼福特算法,是一种动态路由选择协议,用于自治 ...

  6. LA3135简单多路归并(优先队列)

    题意:       有N个任务,每个任务都有自己的时间间隔(就是每t秒请求执行一次)和任务id,这n个任务公用一个cpu,每次我们都执行时间靠前的,如果相同时间内有多个任务,就执行任务id小的,要求模 ...

  7. CVE-2013-1347:Microsoft IE CGenericElement UAF 漏洞利用样本分析

    CVE-2013-1347 漏洞是典型的 IE 浏览器 UAF 漏洞,所以其利用方法和一般的 IE 浏览器漏洞的利用方法非常相似,所以流程大体上可以分为这些步骤:(1) 对象被释放 (2) 精确覆盖被 ...

  8. Access+Mssql+Oracle数据库注入

    Access数据库注入 前言:在常见的注入测试中,由于每个数据库内置架构和应用不同,导致数据库类型将决定注入的手法,Access数据库是小型数据库类型,普遍用于小型WEB应用,其中Access注入手法 ...

  9. vue-axios的总结及项目中的常见封装方法。

    前言 我们知道 vue 2.0版本开始推荐使用 axios 来完成前端 ajax 请求,axios 是一个基于Promise 的 http 库,可以用在浏览器和 node.js 中,axios 成为v ...

  10. 风变编程(Python自学笔记)第10关-工作量计算器

    1.%f的意思是格式化字符串为浮点型,%.1f的意思是格式化字符串为浮点型,并保留1位小数. 2.向上取整:ceil() 使用ceil()方法时需要导入math模块,例如 1 >>> ...