GithubHelp home page GithubHelp logo

prediction-example-with-caffe's Introduction

C++ Prediction Example With Caffe Deep Learning

===================

In this example, we will using cifar10_quick_iter_5000.caffemodel as pre-trained model. And modified cifar10_quick_train_test.prototxt to get argmax for prediction.

Copy files to caffe master directory

Copy files to your caffe master directory. keep the same directories and subdirectories.

caffe-master/examples/images/cat10.png
caffe-master/examples/images/dog10.png
caffe-master/examples/images/truck10.png
caffe-master/examples/prediction_example/file_list.txt
caffe-master/examples/prediction_example/prediction_example.prototxt
caffe-master/tools/prediction_example.cpp

Compile Example

We assume you are ine the caffe master directory, just use make to compile our example.

make

The caffe makefile will automatic find the new example and copy the result to build directory.

caffe-master ikki$ ls ./build/tools/prediction_example*
./build/tools/prediction_example
./build/tools/prediction_example.bin
./build/tools/prediction_example.o
./build/tools/prediction_example.o.warnings.txt

Prediction

Just run the example.

./build/tools/prediction_example
I0120 11:02:45.297869 2008834832 prediction_example.cpp:52] Result size: 3
I0120 11:02:45.297899 2008834832 prediction_example.cpp:55] Blob size: 0
I0120 11:02:45.297905 2008834832 prediction_example.cpp:58] -------------
I0120 11:02:45.297910 2008834832 prediction_example.cpp:59]  prediction :  
I0120 11:02:45.297919 2008834832 prediction_example.cpp:69] ------------------------------------------------------
I0120 11:02:45.297924 2008834832 prediction_example.cpp:73] Pattern:0 class:5 Prob=2.69744e-06
I0120 11:02:45.297940 2008834832 prediction_example.cpp:73] Pattern:1 class:3 Prob=4.0121e-05
I0120 11:02:45.297948 2008834832 prediction_example.cpp:73] Pattern:2 class:9 Prob=0.00531694
I0120 11:02:45.297956 2008834832 prediction_example.cpp:75] -------------

For run on GPU device.

./build/tools/prediction_example GPU 0

prediction-example-with-caffe's People

Contributors

ikkichung avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.