当前位置:网站首页>Yolov3 spp Darknet version to caffemodel and then to OM model
Yolov3 spp Darknet version to caffemodel and then to OM model
2022-06-25 14:47:00 【HELLOWORLD2424】
yolov3-spp darknet Version transfer caffemodel Re turn om Model
Some time ago , I studied how to put YOLOv4 darknet Version of the model is converted to caffemodel It's converting to om Model in Atlas Reasoning on the server , If a passing friend has no impression , You can review the following two posts first .
YOLOv4 darknet Model into caffemodel Re turn om stay Atlas Reasoning on the server
YOLOv4 caffemodel turn om stay Atlas Reasoning on the server
When I was working today, I needed to YOLOv3-spp Model conversion to offline om Model in Altas Reasoning on the server , After practical experiments, it has been successfully converted , Here, write down the process , I hope that's helpful , If you think it's useful , Remember to like, share and pay attention .
YOLOv3-spp And YOLOv3 Only one more than spp(Spatial Pyramid Pooling Spatial pyramid pool structure ), It was proposed by he Kaiming of Microsoft Research Institute , Mainly to solve two problems :
The clipping area is avoided 、 Problems such as image distortion caused by zoom operation ;
It solves the problem of image repetitive feature extraction by convolution neural network , It greatly improves the speed of generating candidate boxes , And the calculation cost is saved .
YOLOv3-spp It's converting to caffemodel Time and YOLOv4 It's similar , Just follow up prototxt The modification of the file is slightly different , The different parts will be described directly below .
1. modify prototxt file
1.1 Input description
Description of the input section ,YOLOv3-spp and YOLOv4 It's exactly the same , The network size here is 1024*1024, So the
name: "Darkent2Caffe"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 608
input_dim: 608
It is amended as follows
input: "data"
input_shape {
dim: 1
dim: 3
dim: 1024
dim: 1024
}
input: "img_info"
input_shape {
dim: 1
dim: 4
}
1.2 unsample layer
And before YOLOv4 Of demo The same with "upsample_param" Keyword as search , That is, we can find the unsample layer , Namely :
layer92-conv
layer {
bottom: "layer92-conv"
top: "layer93-upsample"
name: "layer93-upsample"
type: "Upsample"
upsample_param {
scale: 2
}
}
Change to
layer {
bottom: "layer92-conv"
top: "layer93-upsample"
name: "layer93-upsample"
type: "Upsample"
upsample_param {
scale: 1
stride: 2
}
}
as well as layer104-conv
layer {
bottom: "layer104-conv"
top: "layer105-upsample"
name: "layer105-upsample"
type: "Upsample"
upsample_param {
scale: 2
}
}
Change to
layer {
bottom: "layer104-conv"
top: "layer105-upsample"
name: "layer105-upsample"
type: "Upsample"
upsample_param {
scale: 1
stride: 2
}
}
1.3 YOLO The correlation layer
We all know YOLOv3 Will be output 3 It's a different dimension featuremap, So we need to find these three first Featuremap. Here we use Netron The software opens the completed featuremap Look at these three output layers , Namely :
layer89-conv

layer101-conv

as well as layer113-conv

Then according to , We can write the rest 3 individual YOLO Layer with a YOLODetectionOutput layer , Pay attention to relevant parameters such as classes, boxes,thresh It needs to be modified according to the actual situation of the model , If you don't understand , Please read my previous article , Put the address here again :
YOLOv4 caffemodel turn om stay Atlas Reasoning on the server
Three YOLO layer
layer {
bottom: "layer89-conv"
top: "yolo1_coords"
top: "yolo1_obj"
top: "yolo1_classes"
name: "yolo1"
type: "Yolo"
yolo_param {
boxes: 3
coords: 4
classes: 4
yolo_version: "V3"
softmax: true
background: false
}
}
layer {
bottom: "layer101-conv"
top: "yolo2_coords"
top: "yolo2_obj"
top: "yolo2_classes"
name: "yolo2"
type: "Yolo"
yolo_param {
boxes: 3
coords: 4
classes: 4
yolo_version: "V3"
softmax: true
background: false
}
}
layer {
bottom: "layer113-conv"
top: "yolo3_coords"
top: "yolo3_obj"
top: "yolo3_classes"
name: "yolo3"
type: "Yolo"
yolo_param {
boxes: 3
coords: 4
classes: 4
yolo_version: "V3"
softmax: true
background: false
}
}
One YoloV3DetectionOutput layer
layer {
name: "detection_out3"
type: "YoloV3DetectionOutput"
bottom: "yolo1_coords"
bottom: "yolo2_coords"
bottom: "yolo3_coords"
bottom: "yolo1_obj"
bottom: "yolo2_obj"
bottom: "yolo3_obj"
bottom: "yolo1_classes"
bottom: "yolo2_classes"
bottom: "yolo3_classes"
bottom: "img_info"
top: "box_out"
top: "box_out_num"
yolov3_detection_output_param {
boxes: 3
classes: 4
relative: true
obj_threshold: 0.25
score_threshold: 0.5
iou_threshold: 0.2
pre_nms_topn: 512
post_nms_topn: 1024
biases_high: 116
biases_high: 90
biases_high: 156
biases_high: 198
biases_high: 373
biases_high: 326
biases_high: 30
biases_high: 61
biases_high: 62
biases_high: 45
biases_high: 59
biases_high: 119
biases_high: 10
biases_high: 13
biases_high: 16
biases_high: 30
biases_high: 33
biases_high: 23
}
}
About YoloV3DetectionOutput Of Anchor
stay YOLOv3-spp, If you follow the previous biases_high, biases_mid, biases_low Writing , The size of the detection frame is not suitable for the actual measurement , I put all of them through experiments anchor It's written in biases_high( See... Above YoloV3DetectionOutput) Be able to make om The model is closest to the original model , I don't understand the specific principle , If there are clear students can comment on the area to teach me the principle , thank you ~! As for the following content, it is related to YOLOv4 Partially consistent .
ALL DONE!
The content of this issue is finished , If you think it helps , Hope you can like, share and pay attention , Your attention can give me the motivation to write .
2021/12/22
I write down on my birthday , Sobbing , It's miserable to have to go to work on your birthday .
边栏推荐
- 弹性布局(display:flex;)属性详解
- Complete and detailed compilation of experimental reports
- Customization and encapsulation of go language zap library logger
- 从0到1完全掌握 XSS
- [HBZ sharing] use of locksupport
- 买卖股票的最佳时机
- Where is it safe to open an account for buying funds? Ask for guidance
- 'NVIDIA SMI' is not an internal or external command, nor is it a runnable program or batch file
- [deep learning] multi task learning of multiple datasets data sets missing labels
- Get the parameters in the URL and the interchange between parameters and objects
猜你喜欢

ffmpeg protocol concat 进行ts流合并视频的时间戳计算及其音画同步方式一点浅析

还没弄明白微服务数据架构事务管理+ACID+一致性+CAP+BASE理论吗,看完彻底解决疑惑

Summary of common functions in Oracle Database

电源自动测试系统NSAT-8000,精准高速可靠的电源测试设备

从408改考自主命题,211贵州大学考研改考

【中国海洋大学】考研初试复试资料分享

当了六年程序员第一次搞懂微服务架构的数据一致性,真不容易

Reading the "clean" series for the first time, I didn't think it was a good book

有哪个瞬间让你觉得这个世界出bug了?

定位position(5种方式)
随机推荐
How to choose a technology stack for web applications in 2022
JS Base64 Library Learning
Report on Hezhou air32f103cbt6 development board
How to crop GIF dynamic graph? Take this picture online clipping tool
ffmpeg protocol concat 进行ts流合并视频的时间戳计算及其音画同步方式一点浅析
Partager les points techniques de code et l'utilisation de logiciels pour la communication Multi - clients socket que vous utilisez habituellement
关于win10 版本kicad 卡死的问题, 版本6.x
Is it normal to dig for money? Is it safe to open a stock account?
Output 0 ~ n digits and output multiple times
NBD Network Block Device
Jaspersoft studio adding MySQL database configuration
Two methods to rollback the code in pycharm to the specified version (with screenshot)
【Try to Hack】vulnhub DC1
The best time to buy and sell stocks
买卖股票的最佳时机
For the first time in China, Chinatelecom 5g underground personnel positioning project is officially commercial: it can track the position in real time to ensure operation safety
【深度学习】多任务学习 多个数据集 数据集漏标
Dmsetup command
Share the code technology points and software usage of socket multi client communication
Differences between member variables and local variables