Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters in TensorNet creation function to configure input/output blob #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/node_detectnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ int main(int argc, char **argv)
private_nh.param<float>("mean_pixel_value", mean_pixel, mean_pixel);
private_nh.param<float>("threshold", threshold, threshold);

// input and output blob for DetectNet model
std::string input_blob = DETECTNET_DEFAULT_INPUT;
std::string output_cvg = DETECTNET_DEFAULT_COVERAGE;
std::string output_bbox = DETECTNET_DEFAULT_BBOX;

private_nh.param<std::string>("input_blob", input_blob, input_blob);
private_nh.param<std::string>("output_cvg", output_cvg, output_cvg);
private_nh.param<std::string>("output_bbox", output_bbox, output_bbox);


/*
* load object detection network
Expand All @@ -176,7 +185,7 @@ int main(int argc, char **argv)
private_nh.getParam("class_labels_path", class_labels_path);

// create network using custom model paths
net = detectNet::Create(prototxt_path.c_str(), model_path.c_str(), mean_pixel, class_labels_path.c_str(), threshold);
net = detectNet::Create(prototxt_path.c_str(), model_path.c_str(), mean_pixel, class_labels_path.c_str(), threshold, input_blob.c_str(), output_cvg.c_str(), output_bbox.c_str());
}

if( !net )
Expand Down
11 changes: 9 additions & 2 deletions src/node_imagenet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ int main(int argc, char **argv)
use_model_name = true;
}


// input and output blob for ImageNet model
std::string input_blob = IMAGENET_DEFAULT_INPUT;
std::string output_blob = IMAGENET_DEFAULT_OUTPUT;

private_nh.param<std::string>("input_blob", input_blob, input_blob);
private_nh.param<std::string>("output_blob", output_blob, output_blob);


/*
* load image recognition network
*/
Expand All @@ -140,7 +147,7 @@ int main(int argc, char **argv)
else
{
// create network using custom model paths
net = imageNet::Create(prototxt_path.c_str(), model_path.c_str(), NULL, class_labels_path.c_str());
net = imageNet::Create(prototxt_path.c_str(), model_path.c_str(), NULL, class_labels_path.c_str(), input_blob.c_str(), output_blob.c_str());
}

if( !net )
Expand Down
9 changes: 8 additions & 1 deletion src/node_segnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ int main(int argc, char **argv)
overlay_filter = segNet::FilterModeFromStr(overlay_filter_str.c_str(), segNet::FILTER_LINEAR);
mask_filter = segNet::FilterModeFromStr(mask_filter_str.c_str(), segNet::FILTER_LINEAR);

// input and output blob for SegNet model
std::string input_blob = SEGNET_DEFAULT_INPUT;
std::string output_blob = SEGNET_DEFAULT_OUTPUT;

private_nh.param<std::string>("input_blob", input_blob, input_blob);
private_nh.param<std::string>("output_blob", output_blob, output_blob);


/*
* load segmentation network
Expand All @@ -225,7 +232,7 @@ int main(int argc, char **argv)
private_nh.getParam("class_labels_path", class_labels_path);

// create network using custom model paths
net = segNet::Create(prototxt_path.c_str(), model_path.c_str(), class_labels_path.c_str(), class_colors_path.c_str());
net = segNet::Create(prototxt_path.c_str(), model_path.c_str(), class_labels_path.c_str(), class_colors_path.c_str(), input_blob.c_str(), output_blob.c_str());
}

if( !net )
Expand Down