yolov5 yolov4 yolov4 tensorrt 跨平台优化部署

Yolov5 Yolov4 Yolov3 TensorRT Implementation

news: yolov5 support

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

关注公众号:EigenVision 回复yolo获取交流群号

在这里插入图片描述

INTRODUCTION

The project is the encapsulation of nvidia official yolo-tensorrt implementation. And you must have the trained yolo model(.weights) and .cfg file from the darknet (yolov3 & yolov4). For the yolov5 ,you should prepare the model file (yolov5s.yaml) and the trained weight file (yolov5s.pt) from pytorch.

在这里插入图片描述

  • yolov5s , yolov5m , yolov5l , yolov5x tutorial
    • inequal net input size
    • batch inference
    • support FP32,FP16,INT8
    • daynamic input size
  • yolov4 , yolov4-tiny
  • yolov3 , yolov3-tiny

PLATFORM & PERFORMENCE

  • windows 10
  • ubuntu 18.04
  • L4T (Jetson platform)
modelgpuprecisiondetect time(with pre and post process)
yolov3-416x416jetson nano (15w)FP16250ms
yolov3-416x416jetson xavier nx (15w 6core)FP32120ms
yolov3-416x416jetson xavier nx (15w 6core)FP1645ms
yolov3-416x416jetson xavier nx (15w 6core)INT835ms

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";

	int n_max_batch = 4;	
};

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
  • 3
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值