Publishing 2019 R1 content
[platform/upstream/dldt.git] / tools / accuracy_checker / accuracy_checker / launcher / caffe_installation_readme.md
1 # Caffe Installation Tips
2
3 ## Install OpenCV 3.3 or later with Python3 bindings
4
5 Accuracy Checker uses OpenCV library for image processing. You can miss this step if you are using OpenCV from [OpenVINO toolkit][openvino-get-started].
6
7 ```bash
8 sudo apt-get install libopencv-dev
9 pip install opencv-python
10 ```
11
12 ## Install Caffe with Python3 bindings
13
14 * Clone repository:
15
16 ```bash
17 git clone https://github.com/BVLC/caffe.git
18 cd caffe
19 ```
20
21 * Install Caffe dependencies:
22
23 ```bash
24 sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev
25 sudo apt-get install --no-install-recommends libboost-all-dev
26 pip install -r python/requirements.txt
27 pip install matplotlib
28 ```
29
30 * Build
31
32 If you need CPU only version of caffe add `-DCPU_ONLY=ON` to cmake command.
33
34 ```bash
35 mkdir build && cd build
36 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<caffe/install/dir> -Dpython_version=3 -DBLAS=open ..
37 make
38 sudo make install
39 ```
40
41 * Copy Python library to your python installation.
42
43 ```bash
44 cp -r ../python/caffe $VIRTUAL_ENV/lib/python3.5/site-packages
45 cp --remove-destination lib/_caffe.so $VIRTUAL_ENV/lib/python3.5/site-packages/caffe
46 ```
47
48 ## Check your installation
49
50 You can test prerequisites with the following command. If it does not fail, then you are installed prerequisites correctly:
51
52 ```bash
53 python3 -c 'import caffe, cv2'
54 ```
55
56 [openvino-get-started]: https://software.intel.com/en-us/openvino-toolkit/documentation/get-started