string input and flir test
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ namespace tk { namespace dnn {
|
||||
|
||||
Conv2d::Conv2d( Network *net, int out_ch, int kernelH, int kernelW,
|
||||
int strideH, int strideW, int paddingH, int paddingW,
|
||||
const char* fname_weights, bool batchnorm) :
|
||||
std::string fname_weights, bool batchnorm) :
|
||||
|
||||
LayerWgs(net, net->getOutputDim().c, out_ch, kernelH, kernelW, 1,
|
||||
fname_weights, batchnorm) {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace tk { namespace dnn {
|
||||
|
||||
Dense::Dense(Network *net, int out_ch, const char* fname_weights) :
|
||||
Dense::Dense(Network *net, int out_ch, std::string fname_weights) :
|
||||
LayerWgs(net, net->getOutputDim().tot(), out_ch, 1, 1, 1, fname_weights) {
|
||||
|
||||
output_dim.n = 1;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace tk { namespace dnn {
|
||||
|
||||
LayerWgs::LayerWgs(Network *net, int inputs, int outputs,
|
||||
int kh, int kw, int kl,
|
||||
const char* fname_weights, bool batchnorm) : Layer(net) {
|
||||
std::string fname_weights, bool batchnorm) : Layer(net) {
|
||||
|
||||
this->inputs = inputs;
|
||||
this->outputs = outputs;
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ dnnType* Region::infer(dataDim_t &dim, dnnType* srcData) {
|
||||
|
||||
/* Intepret class */
|
||||
RegionInterpret::RegionInterpret(dataDim_t input_dim, dataDim_t output_dim,
|
||||
int classes, int coords, int num, float thresh, const char* fname_weights) {
|
||||
int classes, int coords, int num, float thresh, std::string fname_weights) {
|
||||
|
||||
this->input_dim = input_dim;
|
||||
this->output_dim = output_dim;
|
||||
|
||||
+2
-2
@@ -11,14 +11,14 @@
|
||||
|
||||
namespace tk { namespace dnn {
|
||||
|
||||
Yolo::Yolo(Network *net, int classes, int num, const char* fname_weights) :
|
||||
Yolo::Yolo(Network *net, int classes, int num, std::string fname_weights) :
|
||||
Layer(net) {
|
||||
|
||||
this->classes = classes;
|
||||
this->num = num;
|
||||
|
||||
// load anchors
|
||||
if(fname_weights != nullptr) {
|
||||
if(fname_weights != "") {
|
||||
int seek = 0;
|
||||
readBinaryFile(fname_weights, num, &mask_h, &mask_d, seek);
|
||||
seek += num;
|
||||
|
||||
@@ -32,7 +32,7 @@ bool Yolo3Detection::init(std::string tensor_path) {
|
||||
num = yRT->num;
|
||||
|
||||
// make a yolo layer for interpret predictions
|
||||
yolo[i] = new tk::dnn::Yolo(nullptr, classes, num, nullptr); // yolo without input and bias
|
||||
yolo[i] = new tk::dnn::Yolo(nullptr, classes, num, ""); // yolo without input and bias
|
||||
yolo[i]->mask_h = new dnnType[num];
|
||||
yolo[i]->bias_h = new dnnType[num*3*2];
|
||||
memcpy(yolo[i]->mask_h, yRT->mask, sizeof(dnnType)*num);
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ bool fileExist(const char *fname) {
|
||||
}
|
||||
|
||||
|
||||
void readBinaryFile(const char* fname, int size, dnnType** data_h, dnnType** data_d, int seek)
|
||||
void readBinaryFile(std::string fname, int size, dnnType** data_h, dnnType** data_d, int seek)
|
||||
{
|
||||
std::ifstream dataFile (fname, std::ios::in | std::ios::binary);
|
||||
std::stringstream error_s;
|
||||
|
||||
Reference in New Issue
Block a user