darknet parser interface
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <iostream>
|
||||||
|
#include "tkdnn.h"
|
||||||
|
|
||||||
|
namespace tk { namespace dnn {
|
||||||
|
|
||||||
|
tk::dnn::Network* DarknetParser(std::string cfg) {
|
||||||
|
|
||||||
|
tk::dnn::dataDim_t dim;
|
||||||
|
tk::dnn::Network *net = new tk::dnn::Network(dim);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
+11
-3
@@ -1,17 +1,23 @@
|
|||||||
#include<iostream>
|
#include<iostream>
|
||||||
#include<vector>
|
#include<vector>
|
||||||
#include "tkdnn.h"
|
#include "tkdnn.h"
|
||||||
|
#include "DarknetParser.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
// Network layout
|
tk::dnn::Network *net = tk::dnn::DarknetParser("../../tests/yolo3/yolo3.cfg");
|
||||||
tk::dnn::dataDim_t dim(1, 3, 416, 416, 1);
|
|
||||||
tk::dnn::Network net(dim);
|
|
||||||
|
|
||||||
|
// Network layout
|
||||||
|
//tk::dnn::dataDim_t dim(1, 3, 416, 416, 1);
|
||||||
|
//tk::dnn::Network net(dim);
|
||||||
|
|
||||||
|
/*
|
||||||
// create yolo3 model
|
// create yolo3 model
|
||||||
std::string bin_path = "yolo3";
|
std::string bin_path = "yolo3";
|
||||||
downloadWeightsifDoNotExist("yolo3/layers/input.bin", bin_path, "https://cloud.hipert.unimore.it/s/jPXmHyptpLoNdNR/download");
|
downloadWeightsifDoNotExist("yolo3/layers/input.bin", bin_path, "https://cloud.hipert.unimore.it/s/jPXmHyptpLoNdNR/download");
|
||||||
int classes = 80;
|
int classes = 80;
|
||||||
|
|
||||||
|
|
||||||
tk::dnn::Yolo *yolo [3];
|
tk::dnn::Yolo *yolo [3];
|
||||||
#include "models/Yolo3.h"
|
#include "models/Yolo3.h"
|
||||||
|
|
||||||
@@ -30,6 +36,7 @@ int main() {
|
|||||||
//print network model
|
//print network model
|
||||||
net.print();
|
net.print();
|
||||||
|
|
||||||
|
|
||||||
//convert network to tensorRT
|
//convert network to tensorRT
|
||||||
tk::dnn::NetworkRT netRT(&net, net.getNetworkRTName("yolo3"));
|
tk::dnn::NetworkRT netRT(&net, net.getNetworkRTName("yolo3"));
|
||||||
|
|
||||||
@@ -96,4 +103,5 @@ int main() {
|
|||||||
ret_cudnn_tensorrt |= checkResult(odim, cudnn_out[i], rt_out[i]) == 0 ? 0 : ERROR_CUDNNvsTENSORRT;
|
ret_cudnn_tensorrt |= checkResult(odim, cudnn_out[i], rt_out[i]) == 0 ? 0 : ERROR_CUDNNvsTENSORRT;
|
||||||
}
|
}
|
||||||
return ret_cudnn | ret_tensorrt | ret_cudnn_tensorrt;
|
return ret_cudnn | ret_tensorrt | ret_cudnn_tensorrt;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user