1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-23 18:09:25 +08:00

Added few tests for torch

This commit is contained in:
arrybn
2017-02-15 12:06:38 +03:00
parent 5d9808b01a
commit b964d3a18b
4 changed files with 55 additions and 15 deletions

View File

@@ -23,6 +23,7 @@ const String keys =
"{c_names c || path to file with classnames for channels (optional, categories.txt) }"
"{result r || path to save output blob (optional, binary format, NCHW order) }"
"{show s || whether to show all output channels or not}"
"{o_blob || output blob's name. If empty, last blob's name in net is used}"
;
std::vector<String> readClassNames(const char *filename);
@@ -112,7 +113,13 @@ int main(int argc, char **argv)
//! [Gather output]
dnn::Blob prob = net.getBlob(net.getLayerNames().back()); //gather output of "prob" layer
String oBlob = net.getLayerNames().back();
if (!parser.get<String>("o_blob").empty())
{
oBlob = parser.get<String>("o_blob");
}
dnn::Blob prob = net.getBlob(oBlob); //gather output of "prob" layer
Mat& result = prob.matRef();