From 26ab8e0253e989a8d810b742539d2227317ad0a7 Mon Sep 17 00:00:00 2001 From: Wenbo Yang Date: Sat, 4 Feb 2017 23:37:16 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8de9d84..ca4a445 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ TODO # For iPhone Simulator -## Step 1: Build Caffe-Mobile Lib with cmake&make +## Step 1: Build Caffe-Mobile Lib with cmake ``` $ git clone --recursive https://github.com/solrex/caffe-mobile.git @@ -18,7 +18,7 @@ $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../third_party/ios-cmake/toolchain/iOS.cmake \ $ make -j 4 ``` -## Step 2: Build Example iOS App: CaffeSimple with Xcode +## Step 2: Build 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](http://caffe.berkeleyvision.org/gathered/examples/mnist.html) 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. @@ -33,7 +33,7 @@ $ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel $CAFFE_MOBILE/examples/io # For iPhone ================== -## Step 1: Build Caffe-Mobile Lib with cmake&make +## Step 1: Build Caffe-Mobile Lib with cmake ``` $ git clone --recursive https://github.com/solrex/caffe-mobile.git @@ -46,7 +46,7 @@ $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../third_party/ios-cmake/toolchain/iOS.cmake \ $ make -j 4 ``` -## Step 2: Build Example iOS App: CaffeSimple with Xcode +## Step 2: Build 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](http://caffe.berkeleyvision.org/gathered/examples/mnist.html) 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. @@ -58,34 +58,30 @@ $ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel $CAFFE_MOBILE/examples/io - 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 +# For MacOSX & Ubuntu ================== -## Step 1: Build Caffe-Mobile Lib with cmake&make - -### OSX 1: Use brew installed protobuf +## Step 1: Install dependency ``` -$ brew install protobuf -$ cd build -$ cmake .. -$ make -j 4 +$ brew install protobuf # MacOSX +$ sudo apt install libprotobuf-dev protobuf-compiler libatlas-dev # Ubuntu ``` -### OSX 2: Use self built protobuf +## Step 2: Build Caffe-Mobile Lib with cmake ``` -$ cd third_party -$ ./build-protobuf-3.1.0.sh +$ git clone --recursive https://github.com/solrex/caffe-mobile.git +$ mkdir build $ cd ../build -$ cmake .. -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf +$ cmake .. $ make -j 4 ``` -## Step 2: Build Caffe-bin with cmake&make +## Step 3: Build Caffe-bin with cmake ``` $ brew install gflags -$ cmake .. -DCMAKE_PREFIX_PATH=$PWD/../third_party/protobuf -DTOOLS +$ cmake .. -DTOOLS $ make -j 4 ``` From da5cad00e10b23ac2ac827d8f1bacc8a39b82dd7 Mon Sep 17 00:00:00 2001 From: Wenbo Yang Date: Sun, 5 Feb 2017 08:09:05 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca4a445..46677a6 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ $ cp $CAFFE/examples/mnist/lenet_iter_10000.caffemodel $CAFFE_MOBILE/examples/io - 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 @@ -85,3 +84,10 @@ $ brew install gflags $ cmake .. -DTOOLS $ make -j 4 ``` + +# Thanks + + - Based on https://github.com/BVLC/caffe + - Inspired by https://github.com/chyh1990/caffe-compact + - Use https://github.com/Yangqing/ios-cmake + - Use https://gist.github.com/TyGuy/e814d23046772a98ae437270e8aaaf08 From 173d0baad223ae9b824cbbfa8d79076610e9d1ea Mon Sep 17 00:00:00 2001 From: Wenbo Yang Date: Sun, 5 Feb 2017 08:17:50 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46677a6..57ab2ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Caffe on Mobile Devices ================== -TODO +iOS/Android Caffe lib with demo APP (CPU_ONLY, NO_BACKWARD, NO_BOOST, NO_HDF5, NO_LEVELDB) # For iPhone Simulator