added yolo4x and yolo4-csp from the github repo and download file corrections

This commit is contained in:
hchandirasekar
2021-03-26 12:18:46 +05:30
parent 557fb732a5
commit a2b0dd62d1
12 changed files with 1444 additions and 40 deletions
File diff suppressed because it is too large Load Diff
+15 -6
View File
@@ -5,8 +5,8 @@
# Training
batch=64
subdivisions=8
width=672
height=672
width=640
height=640
channels=3
momentum=0.949
decay=0.0005
@@ -15,7 +15,7 @@ saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.00261
learning_rate=0.001
burn_in=1000
max_batches = 500500
policy=steps
@@ -26,6 +26,8 @@ mosaic=1
letter_box=1
#optimized_memory=1
[convolutional]
batch_normalize=1
filters=32
@@ -1131,6 +1133,7 @@ size=1
stride=1
pad=1
activation=mish
stopbackward=800
##########################
@@ -1147,7 +1150,7 @@ size=1
stride=1
pad=1
filters=255
activation=linear
activation=logistic
[yolo]
@@ -1156,6 +1159,7 @@ anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 4
classes=80
num=9
jitter=.1
scale_x_y = 2.0
objectness_smooth=0
ignore_thresh = .7
truth_thresh = 1
@@ -1169,6 +1173,7 @@ iou_loss=ciou
nms_kind=diounms
beta_nms=0.6
new_coords=1
max_delta=5
[route]
layers = -4
@@ -1275,7 +1280,7 @@ size=1
stride=1
pad=1
filters=255
activation=linear
activation=logistic
[yolo]
@@ -1284,6 +1289,7 @@ anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 4
classes=80
num=9
jitter=.1
scale_x_y = 2.0
objectness_smooth=1
ignore_thresh = .7
truth_thresh = 1
@@ -1297,6 +1303,7 @@ iou_loss=ciou
nms_kind=diounms
beta_nms=0.6
new_coords=1
max_delta=5
[route]
layers = -4
@@ -1403,7 +1410,7 @@ size=1
stride=1
pad=1
filters=255
activation=linear
activation=logistic
[yolo]
@@ -1412,6 +1419,7 @@ anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 4
classes=80
num=9
jitter=.1
scale_x_y = 2.0
objectness_smooth=1
ignore_thresh = .7
truth_thresh = 1
@@ -1425,3 +1433,4 @@ iou_loss=ciou
nms_kind=diounms
beta_nms=0.6
new_coords=1
max_delta=2
+36
View File
@@ -0,0 +1,36 @@
#include<iostream>
#include<vector>
#include "tkdnn.h"
#include "test.h"
#include "DarknetParser.h"
int main() {
std::string bin_path = "yolo4-csp";
std::vector<std::string> input_bins = {
bin_path + "/layers/input.bin"
};
std::vector<std::string> output_bins = {
bin_path + "/debug/layer144_out.bin",
bin_path + "/debug/layer159_out.bin",
bin_path + "/debug/layer174_out.bin"
};
std::string wgs_path = bin_path + "/layers";
std::string cfg_path = std::string(TKDNN_PATH) + "/tests/darknet/cfg/yolo4-csp.cfg";
std::string name_path = std::string(TKDNN_PATH) + "/tests/darknet/names/coco.names";
downloadWeightsifDoNotExist(input_bins[0], bin_path, "https://cloud.hipert.unimore.it/s/AfzHE4BfTeEm2gH/download");
// parse darknet network
tk::dnn::Network *net = tk::dnn::darknetParser(cfg_path, wgs_path, name_path);
net->print();
//convert network to tensorRT
tk::dnn::NetworkRT *netRT = new tk::dnn::NetworkRT(net, net->getNetworkRTName(bin_path.c_str()));
int ret = testInference(input_bins, output_bins, net, netRT);
net->releaseLayers();
delete net;
delete netRT;
return ret;
}
+1 -1
View File
@@ -17,7 +17,7 @@ int main() {
std::string wgs_path = bin_path + "/layers";
std::string cfg_path = std::string(TKDNN_PATH) + "/tests/darknet/cfg/yolo4x.cfg";
std::string name_path = std::string(TKDNN_PATH) + "/tests/darknet/names/coco.names";
downloadWeightsifDoNotExist(input_bins[0], bin_path, "https://cloud.hipert.unimore.it/s/BLPpiAigZJLorQD/download");
downloadWeightsifDoNotExist(input_bins[0], bin_path, "https://cloud.hipert.unimore.it/s/5MFjtNtgbDGdJEo/download");