mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
dnn: fix documentation links
This commit is contained in:
@@ -89,42 +89,42 @@ How to build OpenCV with DNN module you may find in @ref tutorial_dnn_build.
|
||||
|
||||
## Sample
|
||||
|
||||
@include dnn/samples/squeezenet_halide.cpp
|
||||
@include dnn/squeezenet_halide.cpp
|
||||
|
||||
## Explanation
|
||||
Download Caffe model from SqueezeNet repository: [train_val.prototxt](https://github.com/DeepScale/SqueezeNet/blob/master/SqueezeNet_v1.1/train_val.prototxt) and [squeezenet_v1.1.caffemodel](https://github.com/DeepScale/SqueezeNet/blob/master/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel).
|
||||
|
||||
Also you need file with names of [ILSVRC2012](http://image-net.org/challenges/LSVRC/2012/browse-synsets) classes:
|
||||
[synset_words.txt](https://raw.githubusercontent.com/ludv1x/opencv_contrib/master/modules/dnn/samples/synset_words.txt).
|
||||
[synset_words.txt](https://raw.githubusercontent.com/opencv/opencv/master/modules/samples/data/dnn/synset_words.txt).
|
||||
|
||||
Put these files into working dir of this program example.
|
||||
|
||||
-# Read and initialize network using path to .prototxt and .caffemodel files
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Read and initialize network
|
||||
@snippet dnn/squeezenet_halide.cpp Read and initialize network
|
||||
|
||||
-# Check that network was read successfully
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Check that network was read successfully
|
||||
@snippet dnn/squeezenet_halide.cpp Check that network was read successfully
|
||||
|
||||
-# Read input image and convert to the 4-dimensional blob, acceptable by SqueezeNet v1.1
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Prepare blob
|
||||
@snippet dnn/squeezenet_halide.cpp Prepare blob
|
||||
|
||||
-# Pass the blob to the network
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Set input blob
|
||||
@snippet dnn/squeezenet_halide.cpp Set input blob
|
||||
|
||||
-# Enable Halide backend for layers where it is implemented
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Enable Halide backend
|
||||
@snippet dnn/squeezenet_halide.cpp Enable Halide backend
|
||||
|
||||
-# Make forward pass
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Make forward pass
|
||||
@snippet dnn/squeezenet_halide.cpp Make forward pass
|
||||
Remember that the first forward pass after initialization require quite more
|
||||
time that the next ones. It's because of runtime compilation of Halide pipelines
|
||||
at the first invocation.
|
||||
|
||||
-# Determine the best class
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Determine the best class
|
||||
@snippet dnn/squeezenet_halide.cpp Determine the best class
|
||||
|
||||
-# Print results
|
||||
@snippet dnn/samples/squeezenet_halide.cpp Print results
|
||||
@snippet dnn/squeezenet_halide.cpp Print results
|
||||
For our image we get:
|
||||
|
||||
> Best class: #812 'space shuttle'
|
||||
|
||||
Reference in New Issue
Block a user