GithubHelp home page GithubHelp logo

kevinchenkai / caffe-mobile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solrex/caffe-mobile

0.0 2.0 0.0 190 KB

iOS/Android Caffe Lib with Demo (CPU_ONLY, NO_BACKWARD, NO_BOOST, NO_HDF5, NO_LEVELDB)

License: Other

CMake 5.77% C++ 83.14% Python 0.39% Protocol Buffer 10.70%

caffe-mobile's Introduction

Caffe on Mobile Devices

TODO

For iPhone Simulator

Step 1: Build Caffe-Mobile Lib with cmake&make

$ git clone --recursive https://github.com/solrex/caffe-mobile.git
$ cd caffe-mobile/third_party
$ ./build-protobuf-3.1.0.sh
$ mkdir ../build
$ cd ../build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../third_party/ios-cmake/toolchain/iOS.cmake \
  -DIOS_PLATFORM=SIMULATOR -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf
$ make -j 4

Step 2: Build Example iOS App: CaffeSimple with Xcode

  • For CaffeSimple to run, you need a pre-trained LeNet on MNIST caffe model and the weight file. Follow the instructions in Training LeNet on MNIST with Caffe to train your LeNet Model on MNIST. Then copy the model file caffe/examples/mnist/lenet.prototxt and the trained weight file caffe/examples/mnist/lenet_iter_10000.caffemodel to CaffeSimple app directory.
$ cp $CAFFE/examples/mnist/lenet.prototxt $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/
$ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/
  • Load the Xcode project inside the $CAFFE_MOBILE/examples/ios/simple/ folder, and press Command-R to build and run it on the simulator.

For iPhone

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

Step 1: Build Caffe-Mobile Lib with cmake&make

$ git clone --recursive https://github.com/solrex/caffe-mobile.git
$ cd caffe-mobile/third_party
$ ./build-protobuf-3.1.0.sh
$ mkdir ../build
$ cd ../build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../third_party/ios-cmake/toolchain/iOS.cmake \
  -DIOS_PLATFORM=OS -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf
$ make -j 4

Step 2: Build Example iOS App: CaffeSimple with Xcode

  • For CaffeSimple to run, you need a pre-trained LeNet on MNIST caffe model and the weight file. Follow the instructions in Training LeNet on MNIST with Caffe to train your LeNet Model on MNIST. Then copy the model file caffe/examples/mnist/lenet.prototxt and the trained weight file caffe/examples/mnist/lenet_iter_10000.caffemodel to CaffeSimple app directory.
$ cp $CAFFE/examples/mnist/lenet.prototxt $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/
$ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel $CAFFE_MOBILE/examples/ios/simple/CaffeSimple/data/
  • Load the Xcode project inside the $CAFFE_MOBILE/examples/ios/simple/ folder, and press Command-R to build and run it on your connected device.

For OSX Check built

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

Step 1: Build Caffe-Mobile Lib with cmake&make

OSX 1: Use brew installed protobuf

$ brew install protobuf
$ cd build
$ cmake ..
$ make -j 4

OSX 2: Use self built protobuf

$ cd third_party
$ ./build-protobuf-3.1.0.sh
$ cd ../build
$ cmake .. -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf
$ make -j 4

Step 2: Build Caffe-bin with cmake&make

$ brew install gflags
$ cmake .. -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf -DTOOLS
$ make -j 4

caffe-mobile's People

Contributors

solrex avatar

Watchers

 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.