All Projects → Wulingtian → yolov5_onnx2caffe

Wulingtian / yolov5_onnx2caffe

Licence: other
yolov5 onnx caffe

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to yolov5 onnx2caffe

Onnx Chainer
Add-on package for ONNX format support in Chainer
Stars: ✭ 83 (+13.7%)
Mutual labels:  caffe, onnx
yolov5 tensorrt int8 tools
tensorrt int8 量化yolov5 onnx模型
Stars: ✭ 105 (+43.84%)
Mutual labels:  onnx, yolov5
Keras Oneclassanomalydetection
[5 FPS - 150 FPS] Learning Deep Features for One-Class Classification (AnomalyDetection). Corresponds RaspberryPi3. Convert to Tensorflow, ONNX, Caffe, PyTorch. Implementation by Python + OpenVINO/Tensorflow Lite.
Stars: ✭ 102 (+39.73%)
Mutual labels:  caffe, onnx
Mmdnn
MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
Stars: ✭ 5,472 (+7395.89%)
Mutual labels:  caffe, onnx
pytorch YOLO OpenVINO demo
No description or website provided.
Stars: ✭ 73 (+0%)
Mutual labels:  onnx, yolov5
Pinto model zoo
A repository that shares tuning results of trained models generated by TensorFlow / Keras. Post-training quantization (Weight Quantization, Integer Quantization, Full Integer Quantization, Float16 Quantization), Quantization-aware training. TensorFlow Lite. OpenVINO. CoreML. TensorFlow.js. TF-TRT. MediaPipe. ONNX. [.tflite,.h5,.pb,saved_model,tfjs,tftrt,mlmodel,.xml/.bin, .onnx]
Stars: ✭ 634 (+768.49%)
Mutual labels:  caffe, onnx
Php Opencv
php wrapper for opencv
Stars: ✭ 194 (+165.75%)
Mutual labels:  caffe, onnx
X2paddle
Deep learning model converter for PaddlePaddle. (『飞桨』深度学习模型转换工具)
Stars: ✭ 315 (+331.51%)
Mutual labels:  caffe, onnx
YOLOv4MLNet
Use the YOLO v4 and v5 (ONNX) models for object detection in C# using ML.Net
Stars: ✭ 61 (-16.44%)
Mutual labels:  onnx, yolov5
Deepstream Project
This is a highly separated deployment project based on Deepstream , including the full range of Yolo and continuously expanding deployment projects such as Ocr.
Stars: ✭ 120 (+64.38%)
Mutual labels:  onnx, yolov5
Visualdl
Deep Learning Visualization Toolkit(『飞桨』深度学习可视化工具 )
Stars: ✭ 4,258 (+5732.88%)
Mutual labels:  caffe, onnx
arcface retinaface mxnet2onnx
arcface and retinaface model convert mxnet to onnx.
Stars: ✭ 53 (-27.4%)
Mutual labels:  caffe, onnx
Centerx
This repo is implemented based on detectron2 and centernet
Stars: ✭ 403 (+452.05%)
Mutual labels:  caffe, onnx
Deepo
Setup and customize deep learning environment in seconds.
Stars: ✭ 6,145 (+8317.81%)
Mutual labels:  caffe, onnx
Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (+356.16%)
Mutual labels:  caffe, onnx
Ncnn
ncnn is a high-performance neural network inference framework optimized for the mobile platform
Stars: ✭ 13,376 (+18223.29%)
Mutual labels:  caffe, onnx
ppq
PPL Quantization Tool (PPQ) is a powerful offline neural network quantization tool.
Stars: ✭ 281 (+284.93%)
Mutual labels:  caffe, onnx
Onnx2caffe
pytorch to caffe by onnx
Stars: ✭ 282 (+286.3%)
Mutual labels:  caffe, onnx
Netron
Visualizer for neural network, deep learning, and machine learning models
Stars: ✭ 17,193 (+23452.05%)
Mutual labels:  caffe, onnx
epic-awesome-gamer
🍷 Gracefully claim weekly free games and monthly content from Epic Store.
Stars: ✭ 600 (+721.92%)
Mutual labels:  onnx, yolov5

环境配置

ubuntu:18.04

cuda:10.0

cudnn:7.6.5

caffe: 1.0

OpenCV:3.4.2

Anaconda3:5.2.0

相关的安装包我已经放到百度云盘,可以从如下链接下载: https://pan.baidu.com/s/17bjiU4H5O36psGrHlFdM7A 密码: br7h

cuda和cudnn的安装

可以参考我的另一篇部署文章(TensorRT int8 量化部署 yolov5s 4.0 模型)

Anaconda安装

chmod +x Anaconda3-5.2.0-Linux-x86_64.sh(从上面百度云盘链接下载)

./Anaconda3-5.2.0-Linux-x86_64.sh

按ENTER,然后按q调至结尾

接受协议 yes

安装路径 使用默认路径

执行安装

在使用的用户.bashrc上添加anaconda路径,比如

export PATH=/home/willer/anaconda3/bin:$PATH

caffe安装

git clone https://github.com/Wulingtian/yolov5_caffe.git

cd yolov5_caffe

命令行输入如下内容:

export CPLUS_INCLUDE_PATH=/home/你的用户名/anaconda3/include/python3.6m

make all -j8

make pycaffe -j8

vim ~/.bashrc

export PYTHONPATH=/home/你的用户名/yolov5_caffe/python:$PYTHONPATH

source ~/.bashrc

编译过程踩过的坑

libstdc++.so.6: version `GLIBCXX_3.4.21' not found

解决方案:搞定 libstdc++.so.6: version `GLIBCXX_3.4.21' not found

ImportError: No module named google.protobuf.internal

解决方案:ImportError: No module named google.protobuf.internal

wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or dir

解决方案:caffe : /wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or dir

yolov5s模型转换onnx模型

pip安装onnx和onnx-simplifier

pip install onnx

pip install onnx-simplifier

拉取yolov5官方代码

git clone https://github.com/ultralytics/yolov5.git

训练自己的模型步骤参考yolov5官方介绍,训练完成后我们得到了一个模型文件

cd yolov5

vim models/export.py 修改opset_version为10

python models/export.py --weights 训练得到的模型权重路径 --img-size 训练图片输入尺寸

python -m onnxsim onnx模型名称 yolov5s-simple.onnx 得到最终简化后的onnx模型

onnx模型转换caffe模型

git clone https://github.com/Wulingtian/yolov5_onnx2caffe.git

cd yolov5_onnx2caffe

vim convertCaffe.py

设置onnx_path(上面转换得到的onnx模型),prototxt_path(caffe的prototxt保存路径),caffemodel_path(caffe的caffemodel保存路径)

python convertCaffe.py 得到转换好的caffe模型

caffe模型推理

定位到yolov5_caffe目录下

cd tools

vim caffe_yolov5s.cpp

设置如下参数:

INPUT_W(模型输入宽度)

INPUT_H(模型输入高度)

NUM_CLASS(模型有多少个类别,例如我训练的模型是安全帽检测,只有1类,所以设置为1,不需要加背景类)

NMS_THRESH(做非极大值抑制的阈值)

CONF_THRESH(类别置信度)

prototxt_path(caffe模型的prototxt路径)

caffemodel_path(caffe模型的caffemodel路径)

pic_path(预测图片的路径)

定位到yolov5_caffe目录下

make -j8

cd build

./tools/caffe_yolov5s 输出平均推理时间,以及保存预测图片到当前目录下,至此,部署完成!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].