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
55856bd9
Commit
55856bd9
authored
Aug 11, 2016
by
Vitaliy Lyudvichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating of googlenet sample
parent
4b99c937
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
caffe_googlenet.cpp
modules/dnn/samples/caffe_googlenet.cpp
+6
-18
No files found.
modules/dnn/samples/caffe_googlenet.cpp
View file @
55856bd9
...
...
@@ -88,19 +88,12 @@ int main(int argc, char **argv)
String
modelBin
=
"bvlc_googlenet.caffemodel"
;
String
imageFile
=
(
argc
>
1
)
?
argv
[
1
]
:
"space_shuttle.jpg"
;
//! [Create the importer of Caffe model]
Ptr
<
dnn
::
Importer
>
importer
;
try
//Try to import Caffe GoogleNet model
{
importer
=
dnn
::
createCaffeImporter
(
modelTxt
,
modelBin
);
}
catch
(
const
cv
::
Exception
&
err
)
//Importer can throw errors, we will catch them
{
std
::
cerr
<<
err
.
msg
<<
std
::
endl
;
}
//! [Create the importer of Caffe model]
//! [Read and initialize network]
Net
net
=
dnn
::
readNetFromCaffe
(
modelTxt
,
modelBin
);
//! [Read and initialize network]
if
(
!
importer
)
//! [Check that net was read successfully]
if
(
net
.
empty
())
{
std
::
cerr
<<
"Can't load network by using the following files: "
<<
std
::
endl
;
std
::
cerr
<<
"prototxt: "
<<
modelTxt
<<
std
::
endl
;
...
...
@@ -109,12 +102,7 @@ int main(int argc, char **argv)
std
::
cerr
<<
"http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel"
<<
std
::
endl
;
exit
(
-
1
);
}
//! [Initialize network]
dnn
::
Net
net
;
importer
->
populateNet
(
net
);
importer
.
release
();
//We don't need importer anymore
//! [Initialize network]
//! [Check that net was read successfully]
//! [Prepare blob]
Mat
img
=
imread
(
imageFile
);
...
...
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