Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
662fc9c7
Commit
662fc9c7
authored
Aug 19, 2016
by
Vitaliy Lyudvichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix docs warnings
parent
dcf42525
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
dnn.hpp
modules/dnn/include/opencv2/dnn/dnn.hpp
+2
-2
caffe_googlenet.cpp
modules/dnn/samples/caffe_googlenet.cpp
+4
-2
tutorial_dnn_googlenet.markdown
modules/dnn/tutorials/tutorial_dnn_googlenet.markdown
+5
-5
No files found.
modules/dnn/include/opencv2/dnn/dnn.hpp
View file @
662fc9c7
...
...
@@ -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.
* @detail
s
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
<
Importer
>
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.
* @detail
s
This is shortcut consisting from createCaffeImporter and Net::populateNet calls.
*/
CV_EXPORTS_W
Net
readNetFromCaffe
(
const
String
&
prototxt
,
const
String
&
caffeModel
=
String
());
...
...
modules/dnn/samples/caffe_googlenet.cpp
View file @
662fc9c7
...
...
@@ -84,6 +84,8 @@ std::vector<String> 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 net
work
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 net
work
was read successfully]
//! [Prepare blob]
Mat
img
=
imread
(
imageFile
);
...
...
modules/dnn/tutorials/tutorial_dnn_googlenet.markdown
View file @
662fc9c7
...
...
@@ -29,11 +29,11 @@ Explanation
Put these files into working dir of this program example.
-#
Create the importer of Caffe model
s
@snippet dnn/samples/caffe_googlenet.cpp
Create the importer of Caffe model
-#
Read and initialize network using path to .prototxt and .caffemodel file
s
@snippet dnn/samples/caffe_googlenet.cpp
Read and initialize network
-# C
reate the network and initialize its by using the created importer
@snippet dnn/samples/caffe_googlenet.cpp
Initialize network
-# C
heck 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 1x
2x224x224 shape by using special @ref cv::dnn::Blob
constructor.
Next, we convert the image to 4-dimensional blob (so-called batch) with 1x
3x224x224 shape by using special cv::dnn::Blob::fromImages
constructor.
-# Pass the blob to the network
@snippet dnn/samples/caffe_googlenet.cpp Set input blob
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment