2 [![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
4 This Installation will help you get started to setup Caffe-HRT on RK3399 quickly.
7 ## 2.1 General dependencies installation
8 sudo apt-get install git cmake scons protobuf-compiler libgflags-dev libgoogle-glog-dev
9 sudo apt-get install libblas-dev libhdf5-serial-dev liblmdb-dev libleveldb-dev
10 sudo apt-get install liblapack-dev libsnappy-dev python-numpy
11 sudo apt-get install libprotobuf-dev libopenblas-dev libgtk2.0-dev
12 sudo apt-get install python-yaml python-numpy python-scipy python-six
14 sudo apt-get install --no-install-recommends libboost-all-dev
16 ## 2.2 Download source code
20 #### Download "OpenCV"
21 wget --no-check-certificate https://github.com/opencv/opencv/archive/3.3.0.tar.gz
23 #### Download "gen-pkg-config-pc"
24 wget ftp://ftp.openailab.net/tools/script/gen-pkg-config-pc.sh
25 chmod +x ./gen-pkg-config-pc.sh
27 git clone https://github.com/ARM-software/ComputeLibrary.git
29 #### Download "Caffe-HRT" :
30 git clone https://github.com/OAID/Caffe-HRT.git
31 #### Download "Googletest" :
32 git clone https://github.com/google/googletest.git
40 cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/AID/opencv3.3.0 ..
42 sudo ~/gen-pkg-config-pc.sh /usr/local/AID
47 aarch64-linux-gnu-gcc opencl-1.2-stubs/opencl_stubs.c -Iinclude -shared -o build/libOpenCL.so
48 scons Werror=1 -j4 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
49 wget ftp://ftp.openailab.net/tools/script/Computelibrary/Makefile
51 sudo ~/gen-pkg-config-pc.sh /usr/local/AID
58 sudo ~/gen-pkg-config-pc.sh /usr/local/AID
60 ## 3.4 Build Unit tests
61 ##### Build the gtest libraries
63 cmake -D CMAKE_INSTALL_PREFIX=/usr/local/AID/googletest CMakeLists.txt
67 ##### Build Caffe Unit tests
68 cd ~/Caffe-HRT/unit_tests
72 ## 3.5 To Configure The Libraries
73 sudo ~/gen-pkg-config-pc.sh /usr/local/AID
78 cd ~/Caffe-HRT/data/ilsvrc12
79 sudo chmod +x get_ilsvrc_aux.sh
82 ./scripts/download_model_binary.py ./models/bvlc_reference_caffenet
83 ./distribute/bin/classification.bin models/bvlc_reference_caffenet/deploy.prototxt models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel data/ilsvrc12/imagenet_mean.binaryproto data/ilsvrc12/synset_words.txt examples/images/cat.jpg
85 ---------- Prediction for examples/images/cat.jpg ----------
86 0.3094 - "n02124075 Egyptian cat"
87 0.1761 - "n02123159 tiger cat"
88 0.1221 - "n02123045 tabby, tabby cat"
89 0.1132 - "n02119022 red fox, Vulpes vulpes"
90 0.0421 - "n02085620 Chihuahua"
92 #### 4.2 Run Unit test
93 cd ~/Caffe-HRT/unit_tests
96 [==========] 29 tests from 6 test cases ran. (1236 ms total) [ PASSED ] 29 tests.