diff --git a/modules/dnn/include/opencv2/dnn/dnn.hpp b/modules/dnn/include/opencv2/dnn/dnn.hpp index 02ef68ded..ce4b40e4f 100644 --- a/modules/dnn/include/opencv2/dnn/dnn.hpp +++ b/modules/dnn/include/opencv2/dnn/dnn.hpp @@ -221,7 +221,7 @@ namespace dnn //! This namespace is used for dnn module functionlaity. CV_WRAP void allocate(); /** @brief Runs forward pass to compute output of layer @p toLayer. - * @detail By default runs forward pass for the whole network. + * @details By default runs forward pass for the whole network. */ CV_WRAP void forward(LayerId toLayer = String()); /** @brief Runs forward pass to compute output of layer @p toLayer, but computations start from @p startLayer */ @@ -295,7 +295,7 @@ namespace dnn //! This namespace is used for dnn module functionlaity. CV_EXPORTS_W Ptr createCaffeImporter(const String &prototxt, const String &caffeModel = String()); /** @brief Reads a network model stored in Caffe model files. - * @detail This is shortcut consisting from createCaffeImporter and Net::populateNet calls. + * @details This is shortcut consisting from createCaffeImporter and Net::populateNet calls. */ CV_EXPORTS_W Net readNetFromCaffe(const String &prototxt, const String &caffeModel = String()); diff --git a/modules/dnn/samples/caffe_googlenet.cpp b/modules/dnn/samples/caffe_googlenet.cpp index 240171a39..ddd5d8bab 100644 --- a/modules/dnn/samples/caffe_googlenet.cpp +++ b/modules/dnn/samples/caffe_googlenet.cpp @@ -84,6 +84,8 @@ std::vector readClassNames(const char *filename = "synset_words.txt") int main(int argc, char **argv) { + cv::dnn::initModule(); //Required if OpenCV is built as static libs + String modelTxt = "bvlc_googlenet.prototxt"; String modelBin = "bvlc_googlenet.caffemodel"; String imageFile = (argc > 1) ? argv[1] : "space_shuttle.jpg"; @@ -92,7 +94,7 @@ int main(int argc, char **argv) Net net = dnn::readNetFromCaffe(modelTxt, modelBin); //! [Read and initialize network] - //! [Check that net was read successfully] + //! [Check that network was read successfully] if (net.empty()) { std::cerr << "Can't load network by using the following files: " << std::endl; @@ -102,7 +104,7 @@ int main(int argc, char **argv) std::cerr << "http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel" << std::endl; exit(-1); } - //! [Check that net was read successfully] + //! [Check that network was read successfully] //! [Prepare blob] Mat img = imread(imageFile); diff --git a/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown b/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown index 87b60acef..1eaaf251a 100644 --- a/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown +++ b/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown @@ -29,11 +29,11 @@ Explanation Put these files into working dir of this program example. --# Create the importer of Caffe models - @snippet dnn/samples/caffe_googlenet.cpp Create the importer of Caffe model +-# Read and initialize network using path to .prototxt and .caffemodel files + @snippet dnn/samples/caffe_googlenet.cpp Read and initialize network --# Create the network and initialize its by using the created importer - @snippet dnn/samples/caffe_googlenet.cpp Initialize network +-# Check that network was read successfully + @snippet dnn/samples/caffe_googlenet.cpp Check that network was read successfully -# Read input image and convert to the blob, acceptable by GoogleNet @snippet dnn/samples/caffe_googlenet.cpp Prepare blob @@ -41,7 +41,7 @@ Explanation Now image is actually a 3-dimensional array with 224x224x3 shape. - Next, we convert the image to 4-dimensional blob (so-called batch) with 1x2x224x224 shape by using special @ref cv::dnn::Blob constructor. + Next, we convert the image to 4-dimensional blob (so-called batch) with 1x3x224x224 shape by using special cv::dnn::Blob::fromImages constructor. -# Pass the blob to the network @snippet dnn/samples/caffe_googlenet.cpp Set input blob