Giter Site home page Giter Site logo

trtinferenceforyolo's Introduction

TRTInferenceForYoloX

为沈阳航空航天大学TUP机器人实验室设计的Yolox Tensorrt高性能推理加速模块

适配模型仓库 TUP-NN-Train-2

Yolov5 v6.0版:TRTInferenceForYolov5

Author: INIF-FISH [email protected]

环境

[Recommend]

Eigen3 3.3.7

Cuda 11.8

cudnn 8.9.0

OpenCV 4.6.0

Tensorrt 8.5.3

使用

#include "TRTInferenceForYoloX/TRTInfer/include/Inference.h"
...
TRTInferV1::TRTInfer myInfer(const int device);
nvinfer1::IHostMemory *data = myInfer.createEngine(const std::string onnx_path, unsigned int maxBatchSize, int input_h, int input_w); //[Optional]
myInfer.saveEngineFile(IHostMemory* data, const std::string engine_file_path); //[Optional]
myInfer.initModule(const std::string engine_file_path, const int batch_size, const int num_apex, const int num_classes, const int num_colors, const int topK);
std::vector<cv::Mat> frames;
myInfer.calculate_inter_frame_compensation(const int limited_fps); //[Optional]
...
while(...)
{
    ...
    std::vector<std::vector<TRTInferV1::DetectObject>> result = myInfer.doInference(std::vector<cv::Mat> &frames, float confidence_threshold, float nms_threshold);
    std::vector<std::vector<TRTInferV1::DetectObject>> result = myInfer.doInferenceLimitFPS(std::vector<cv::Mat> &frames, float confidence_threshold, float nms_threshold, const int limited_fps); //[Optional]
    ...
}
...
myInfer.unInitModule(); //[Optional]

注意:应根据sample中CMakeLists.txt作适当修改以适配不同环境/设备,特别注意显卡架构代码

trtinferenceforyolo's People

Contributors

inif-fish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.