![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
onnxruntime
文章平均质量分 52
Mr.Q
纸上得来终觉浅,绝知此事要躬行。 ---陆游
展开
-
opencv dnn部署onnx模型
代码】opencvdnn部署onnx模型。原创 2022-07-25 11:06:08 · 1817 阅读 · 5 评论 -
window 安装onnx和onnxruntime-gpu(python版)
window安装onnx python版,并进行测试原创 2022-02-12 10:49:07 · 4358 阅读 · 0 评论 -
window通过nuget安装onnxruntime-gpu(c++版)
离线安装gpu版onnxruntime原创 2022-02-11 13:55:38 · 4113 阅读 · 0 评论 -
c#调用c++类中的方法(onnx C++部署)
环境:vs2019 community场景:探索c#调用C++类,用于部署深度学习onnxC++模型。创建c++空项目Project3在project3下新建AIDetector类ai_detector.h#pragma once#include <stdio.h>#include <stdlib.h>#include <iostream>#ifdef CaculateDLL_EXPORTS#define Calculate_EX.原创 2021-11-02 16:55:03 · 1055 阅读 · 0 评论 -
c# 部署onnx定位模型
1.环境gpu3060+cuda11.1+vs2019+Microsoft.ML.OnnxRuntime+SixLabors.ImageSharp2.代码using System;using System.Collections.Generic;using System.IO;using System.Linq;using Microsoft.ML.OnnxRuntime.Tensors;using SixLabors.ImageSharp;using SixLabor原创 2021-10-29 16:44:48 · 2671 阅读 · 13 评论 -
c# 部署onnx分类模型
1.环境gpu3060+cuda11.1+vs2019+Microsoft.ML.OnnxRuntime+SixLabors.ImageSharp2.代码using System;using System.Collections.Generic;using System.Linq;using Microsoft.ML.OnnxRuntime.Tensors; // DenseTensorusing SixLabors.ImageSharp; // Image, S.原创 2021-10-29 15:55:56 · 3833 阅读 · 19 评论 -
onnx节点类型对应的TensorRT api
以resnet18为例。1. input节点细则:// const char* INPUT_BLOB_NAME = "data";// static const int INPUT_H = 224;// static const int INPUT_W = 224;// DataType dt = DataType::kFLOAT// Create input tensor of shape { 3, INPUT_H, INPUT_W } with name INPUT_BL原创 2021-07-27 13:37:00 · 984 阅读 · 0 评论 -
C++部署onnx模型(C++和Python3混合编程)
1. 纯python部署(onnx模型)import osimport timeimport numpy as npimport onnxruntimeimport jsonimport cv2def imnormalize(img, mean, std, to_rgb=True): """Normalize an image with mean and std. Args: img (ndarray): Image to be normalized原创 2021-05-11 15:28:44 · 2907 阅读 · 0 评论 -
#ifndef def的作用
记录备忘1.报错信息In file included from /home/zxq/CLionProjects/test_my_inference_onnx/include/detector.cpp:9:0:/home/zxq/CLionProjects/test_my_inference_onnx/include/detector.h:14:7: error: redefinition of ‘class Detector’class Detector { ^~~~~~~~...原创 2021-05-09 17:07:57 · 243 阅读 · 0 评论 -
cuda加速pth和onnx模型对比-python部署
1.数据和网络模型数据:[1, 3, 256, 256].模型:resnet182.cuda加速pth模型用时(s)平均用时7ms0.0083842277526855470.0084416866302490230.0069284439086914060.0072393417358398440.0068137645721435550.0069024562835693360.0067038536071777340.006385803222656250.00694298744原创 2021-05-05 18:09:09 · 1294 阅读 · 0 评论 -
pytorch转onnx模型(支持batch输入)
python转化代码:import torchimport torchvision# use Trace to export onnx modeldummy_input = torch.randn(10, 3, 224, 224, device='cuda') # 定义模型的输入shapemodel = torchvision.models.alexnet(pretrained=True).cuda() # if delete cuda(), will generate onnx mo.原创 2021-05-05 10:58:19 · 1162 阅读 · 0 评论 -
使用cuda和tensorrt加速对比-C++部署pytorch模型
1.网络模型和数据SSD网络,图片大小(w,h)=(480, 640)SSD检测结果2.cuda加速处理一张图片的时间[ 0 ] 695.201 ms.[ 1 ] 42.9589 ms.[ 2 ] 42.2552 ms.[ 3 ] 40.0333 ms.[ 4 ] 40.5067 ms.[ 5 ] 42.2043 ms.[ 6 ] 42.2497 ms.[ 7 ] 43.8587 ms.[ 8 ] 41.9123 ms.[ 9 ] 42.1796 ms.[ 10原创 2021-05-05 09:47:02 · 2175 阅读 · 0 评论 -
Clion中添加Environment Variables
1.场景执行可执行文件时,他依赖于第三方包:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../lib/cudnn:../lib/my_onnx:../lib/onnxruntime:../lib/opencv:../lib/trt./test_my_inference_onnx所以需要把命令行中的export LD_LIBRARY_PATH添加环境变量方式,改成Clion IDE中添加方式,方便断点调试。2.Clion中添加Environment V原创 2021-05-04 11:43:34 · 3565 阅读 · 0 评论 -
ubuntu 编译onnxruntime源码
编译成功截图:1.拉取源码# clone指定分支 发布版1.7.2git clone -b rel-1.7.2 https://github.com/microsoft/onnxruntime.git# 拉取子项目git submodule update --init --recursive拉取子项目非常耗时,可以点击下面的子项目链接,下载下来,再解压复制到对应的目录中检查是否还有子类项目需要拉取:git submodule update --init --rec.原创 2021-04-29 14:55:24 · 3334 阅读 · 0 评论