Skip to content
Search

Caffe:ImageNetClassifying

lastmod 2025-02-15created 2015-10-168 edits

Notes on Instant recognition with Caffe. 1

C++ example

For a sample example applied to C++, see examples/cpp_classification/classification.cpp. Usage is as follows.

$ ./classification
Usage: ./classification deploy.prototxt network.caffemodel mean.binaryproto labels.txt img.jpg

Actual usage produces output like the following.

$ ./classification \
        /home/your/Project/caffe/models/bvlc_reference_caffenet/deploy.prototxt \
        /home/your/Project/caffe/models/bvlc_reference_caffenet/caffenet_train_iter_450000.caffemodel \
        /home/your/Project/caffe/data/ilsvrc12/imagenet_mean.binaryproto \
        /home/your/Project/caffe/data/ilsvrc12/synset_words.txt \
        ~/Downloads/f12.png
---------- Prediction for /home/your/Downloads/f12.png ----------
1.0000 - "n01443537 FIRE"
0.0000 - "n01440764 NOFIRE"
0.0000 - "n02974003 car wheel"
0.0000 - "n07613480 trifle"
0.0000 - "n02364673 guinea pig, Cavia cobaya"

(Note: the synset_words.txt file, which corresponds to labels.txt, was partially modified)

See also

Favorite site

References


  1. Also called Classifying. ↩

author Zer0 sitemap