camenduru commited on
Commit
f5bb0c0
·
1 Parent(s): f67df11

thanks to openpose ❤

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .doc_autogeneration.doxygen +0 -0
  2. .gitattributes +31 -0
  3. .github/CI_deprecated/.travis.yml +162 -0
  4. .github/CI_deprecated/Readme_Travis_badges_table_and_backup_instructions.md +13 -0
  5. .github/CI_deprecated/generate_gh_pages.sh +104 -0
  6. .github/Logo_doxygen_black.png +0 -0
  7. .github/Logo_main_black.png +0 -0
  8. .github/issue_template.md +85 -0
  9. .github/media/body_heat_maps.png +3 -0
  10. .github/media/dance_foot.gif +3 -0
  11. .github/media/installation/cmake_im_1.png +0 -0
  12. .github/media/installation/cmake_im_1_windows.png +0 -0
  13. .github/media/installation/cmake_im_2.png +0 -0
  14. .github/media/installation/cmake_im_2_windows.png +0 -0
  15. .github/media/installation/cmake_im_2_windows_new.png +0 -0
  16. .github/media/installation/cmake_im_3.png +0 -0
  17. .github/media/installation/cmake_im_3_windows.png +0 -0
  18. .github/media/installation/cmake_im_5.png +0 -0
  19. .github/media/keypoints_face.png +0 -0
  20. .github/media/keypoints_hand.odt +0 -0
  21. .github/media/keypoints_hand.png +0 -0
  22. .github/media/keypoints_pose_18.png +0 -0
  23. .github/media/keypoints_pose_25.png +0 -0
  24. .github/media/openpose3d.gif +0 -0
  25. .github/media/openpose_vs_competition.png +0 -0
  26. .github/media/paf_heat_maps.png +3 -0
  27. .github/media/pose_face.gif +3 -0
  28. .github/media/pose_face_hands.gif +3 -0
  29. .github/media/pose_hands.gif +3 -0
  30. .github/media/shake.gif +3 -0
  31. .github/media/unity_body_foot.png +0 -0
  32. .github/media/unity_hand_face.png +0 -0
  33. .github/media/unity_main.png +0 -0
  34. .github/root_index.html +8 -0
  35. .github/stale.yml +17 -0
  36. .github/workflows/main.yml +295 -0
  37. .gitignore +139 -0
  38. .gitmodules +6 -0
  39. 3rdparty/Versions.txt +38 -0
  40. 3rdparty/caffe/.Doxyfile +0 -0
  41. 3rdparty/caffe/.github/ISSUE_TEMPLATE.md +34 -0
  42. 3rdparty/caffe/.gitignore +99 -0
  43. 3rdparty/caffe/.travis.yml +67 -0
  44. 3rdparty/caffe/CMakeLists.txt +127 -0
  45. 3rdparty/caffe/CONTRIBUTING.md +72 -0
  46. 3rdparty/caffe/CONTRIBUTORS.md +19 -0
  47. 3rdparty/caffe/INSTALL.md +7 -0
  48. 3rdparty/caffe/LICENSE +44 -0
  49. 3rdparty/caffe/Makefile +714 -0
  50. 3rdparty/caffe/Makefile.config.Ubuntu14_cuda7.example +125 -0
.doc_autogeneration.doxygen ADDED
The diff for this file is too large to render. See raw diff
 
.gitattributes CHANGED
@@ -38,3 +38,34 @@ pose_iter_116000.caffemodel filter=lfs diff=lfs merge=lfs -text
38
  pose_iter_160000.caffemodel filter=lfs diff=lfs merge=lfs -text
39
  pose_iter_440000.caffemodel filter=lfs diff=lfs merge=lfs -text
40
  pose_iter_584000.caffemodel filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  pose_iter_160000.caffemodel filter=lfs diff=lfs merge=lfs -text
39
  pose_iter_440000.caffemodel filter=lfs diff=lfs merge=lfs -text
40
  pose_iter_584000.caffemodel filter=lfs diff=lfs merge=lfs -text
41
+ .github/media/body_heat_maps.png filter=lfs diff=lfs merge=lfs -text
42
+ .github/media/dance_foot.gif filter=lfs diff=lfs merge=lfs -text
43
+ .github/media/paf_heat_maps.png filter=lfs diff=lfs merge=lfs -text
44
+ .github/media/pose_face.gif filter=lfs diff=lfs merge=lfs -text
45
+ .github/media/pose_face_hands.gif filter=lfs diff=lfs merge=lfs -text
46
+ .github/media/pose_hands.gif filter=lfs diff=lfs merge=lfs -text
47
+ .github/media/shake.gif filter=lfs diff=lfs merge=lfs -text
48
+ 3rdparty/windows/wget/wget.exe filter=lfs diff=lfs merge=lfs -text
49
+ 3rdparty/windows/wget/wget.exe.debug filter=lfs diff=lfs merge=lfs -text
50
+ build/caffe/lib/libcaffe.so filter=lfs diff=lfs merge=lfs -text
51
+ build/caffe/lib/libcaffe.so.1.0.0 filter=lfs diff=lfs merge=lfs -text
52
+ build/caffe/lib/libcaffeproto.a filter=lfs diff=lfs merge=lfs -text
53
+ build/caffe/src/openpose_lib-build/CMakeFiles/hdf5/a.out filter=lfs diff=lfs merge=lfs -text
54
+ build/caffe/src/openpose_lib-build/lib/libcaffe.so filter=lfs diff=lfs merge=lfs -text
55
+ build/caffe/src/openpose_lib-build/lib/libcaffe.so.1.0.0 filter=lfs diff=lfs merge=lfs -text
56
+ build/caffe/src/openpose_lib-build/lib/libcaffeproto.a filter=lfs diff=lfs merge=lfs -text
57
+ build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o filter=lfs diff=lfs merge=lfs -text
58
+ build/examples/deprecated/CMakeFiles/tutorial_add_module_custom_post_processing.bin.dir/tutorial_add_module_custom_post_processing.cpp.o filter=lfs diff=lfs merge=lfs -text
59
+ build/examples/tutorial_api_cpp/CMakeFiles/13_asynchronous_custom_input_output_and_datum.bin.dir/13_asynchronous_custom_input_output_and_datum.cpp.o filter=lfs diff=lfs merge=lfs -text
60
+ build/examples/tutorial_api_cpp/CMakeFiles/18_synchronous_custom_all_and_datum.bin.dir/18_synchronous_custom_all_and_datum.cpp.o filter=lfs diff=lfs merge=lfs -text
61
+ build/src/openpose/CMakeFiles/openpose.dir/core/array.cpp.o filter=lfs diff=lfs merge=lfs -text
62
+ build/src/openpose/core/CMakeFiles/openpose_core.dir/array.cpp.o filter=lfs diff=lfs merge=lfs -text
63
+ build/src/openpose/core/libopenpose_core.so filter=lfs diff=lfs merge=lfs -text
64
+ build/src/openpose/face/libopenpose_face.so filter=lfs diff=lfs merge=lfs -text
65
+ build/src/openpose/gpu/libopenpose_gpu.so filter=lfs diff=lfs merge=lfs -text
66
+ build/src/openpose/hand/libopenpose_hand.so filter=lfs diff=lfs merge=lfs -text
67
+ build/src/openpose/libopenpose.so filter=lfs diff=lfs merge=lfs -text
68
+ build/src/openpose/libopenpose.so.1.7.0 filter=lfs diff=lfs merge=lfs -text
69
+ build/src/openpose/net/libopenpose_net.so filter=lfs diff=lfs merge=lfs -text
70
+ build/src/openpose/pose/libopenpose_pose.so filter=lfs diff=lfs merge=lfs -text
71
+ examples/media/video.avi filter=lfs diff=lfs merge=lfs -text
.github/CI_deprecated/.travis.yml ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # # This will run on Travis' 'new' container-based infrastructure
2
+
3
+ # # Blacklist
4
+ # branches:
5
+ # only:
6
+ # - master
7
+
8
+ # # Environment variables + OS + other parameters
9
+ # global:
10
+ # - GH_REPO_NAME: openpose
11
+ # - DOXYFILE: $CI_BUILD_DIR/.doc_autogeneration.doxygen
12
+ # # Set this in Environment Variables on travis-ci.org
13
+ # # - GH_REPO_REF: github.com/<user_name>/openpose.git
14
+ # matrix:
15
+ # # Use a build matrix to test many builds in parallel
16
+ # # envvar defaults:
17
+ # # WITH_CMAKE: true
18
+ # # WITH_PYTHON: false
19
+ # # WITH_CUDA: true
20
+ # # WITH_CUDNN: true
21
+ # # WITH_OPEN_CL: false
22
+ # # WITH_MKL: false
23
+ # include:
24
+ # # Ubuntu 16.04
25
+ # # Ubuntu 16.04 - Default - CMake - CUDA
26
+ # - os: linux
27
+ # dist: xenial
28
+ # env: NAME="U16-default-cmake-cuda8"
29
+ # sudo: required
30
+ # # Ubuntu 16.04 - Python - CMake - CUDA
31
+ # - os: linux
32
+ # dist: xenial
33
+ # env: NAME="U16-python-cmake-cuda8" WITH_PYTHON=true
34
+ # sudo: required
35
+ # # Generate and deploy documentation
36
+ # after_success:
37
+ # - cd $CI_BUILD_DIR
38
+ # - chmod +x scripts/generate_gh_pages.sh
39
+ # - ./scripts/generate_gh_pages.sh
40
+ # # Ubuntu 16.04 - Python - CMake - CPU
41
+ # - os: linux
42
+ # dist: xenial
43
+ # env: NAME="U16-python-cmake-cpu" WITH_PYTHON=true WITH_CUDA=false
44
+ # sudo: required
45
+ # # Ubuntu 16.04 - Python - CMake - OpenCL
46
+ # - os: linux
47
+ # dist: xenial
48
+ # env: NAME="U16-python-cmake-opencl" WITH_PYTHON=true WITH_CUDA=false WITH_OPEN_CL=true
49
+ # sudo: required
50
+ # # Ubuntu 16.04 - Python - CMake - CPU - Debug
51
+ # - os: linux
52
+ # dist: xenial
53
+ # env: NAME="U16-python-cmake-cpu-debug" WITH_PYTHON=true WITH_CUDA=false WITH_DEBUG=true
54
+ # sudo: required
55
+ # # Ubuntu 16.04 - Python - CMake - CPU - Unity
56
+ # - os: linux
57
+ # dist: xenial
58
+ # env: NAME="U16-python-cmake-cpu-unity" WITH_PYTHON=true WITH_UNITY=true WITH_CUDA=false
59
+ # sudo: required
60
+
61
+ # # Mac OSX
62
+ # # Mac OSX - Python - CMake - CPU
63
+ # - os: osx
64
+ # osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
65
+ # env: NAME="OSX-python-cmake-cpu" WITH_CUDA=false WITH_PYTHON=true
66
+ # sudo: required
67
+ # # Mac OSX - Python - CMake - OpenCL
68
+ # - os: osx
69
+ # osx_image: xcode10.1 # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
70
+ # env: NAME="OSX-default-cmake-opencl" WITH_CUDA=false WITH_OPEN_CL=true
71
+ # sudo: required
72
+ # # Mac OSX - Python - CMake - CPU - Debug
73
+ # - os: osx
74
+ # osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
75
+ # env: NAME="OSX-python-cmake-cpu-debug" WITH_CUDA=false WITH_PYTHON=true WITH_DEBUG=true
76
+ # sudo: required
77
+ # # Mac OSX - Python - CMake - CPU - Unity
78
+ # - os: osx
79
+ # osx_image: xcode9.4 # xcode10.1 does not work with Python # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
80
+ # env: NAME="OSX-python-cmake-cpu-unity" WITH_CUDA=false WITH_PYTHON=true WITH_UNITY=true
81
+ # sudo: required
82
+ # # Mac OSX - Default - CMake - CPU
83
+ # - os: osx
84
+ # osx_image: xcode10.1 # Versions: https://docs.travis-ci.com/user/languages/objective-c#supported-xcode-versions
85
+ # env: NAME="OSX-default-cmake-cpu" WITH_CUDA=false
86
+ # sudo: required
87
+
88
+ # # # TO-DO: To be implemented
89
+ # # # Windows
90
+ # # # Windows - Default - CMake - CUDA
91
+ # # - os: windows
92
+ # # env: NAME="W10-default-cmake-cuda8"
93
+
94
+ # # Ubuntu (others)
95
+ # # Ubuntu 16.04 - Default - CMake - CPU
96
+ # - os: linux
97
+ # dist: xenial
98
+ # env: NAME="U16-default-cmake-cpu" WITH_CUDA=false
99
+ # sudo: required
100
+ # # Ubuntu 16.04 - Default - Make - CUDA
101
+ # - os: linux
102
+ # dist: xenial
103
+ # env: NAME="U16-default-make-cuda8" WITH_CMAKE=false
104
+ # sudo: required
105
+ # # # TO-DO: To be implemented
106
+ # # # Ubuntu 16.04 - Default - CMake - CPU MKL
107
+ # # - os: linux
108
+ # # dist: xenial
109
+ # # env: NAME="U16-default-cmake-cpu-mkl" WITH_CUDA=false WITH_MKL=true
110
+ # # sudo: required
111
+ # # # Ubuntu 16.04 - Python - CMake - OpenCL
112
+ # # - os: linux
113
+ # # dist: xenial
114
+ # # env: NAME="U16-python-cmake-opencl" WITH_PYTHON=true WITH_CUDA=false WITH_OPEN_CL=true
115
+ # # sudo: required
116
+ # # # Unnecessary/redundant ones
117
+ # # # Ubuntu 16.04 - Default - CMake - CUDA - no cuDNN
118
+ # # - os: linux
119
+ # # dist: xenial
120
+ # # env: NAME="U16-default-cmake-cuda8-nocudnn" WITH_CUDNN=false
121
+ # # sudo: required
122
+ # # Ubuntu 14.04 - Default - CMake - CPU
123
+ # - os: linux
124
+ # dist: trusty
125
+ # env: NAME="U14-default-cmake-cpu" WITH_CUDA=false
126
+ # sudo: required
127
+ # # Ubuntu 14.04 - Default - Make - CUDA
128
+ # - os: linux
129
+ # dist: trusty
130
+ # env: NAME="U14-default-make-cuda8" WITH_CMAKE=false
131
+ # sudo: required
132
+ # # # Unnecessary/redundant ones
133
+ # # # Ubuntu 14.04 - Default - CMake - CUDA
134
+ # # - os: linux
135
+ # # dist: trusty
136
+ # # env: NAME="U14-default-cmake-cuda8"
137
+ # # sudo: required
138
+
139
+ # # Install apt dependencies
140
+ # addons:
141
+ # apt:
142
+ # packages:
143
+ # - doxygen
144
+ # - doxygen-doc
145
+ # - doxygen-latex
146
+ # - doxygen-gui
147
+ # - graphviz
148
+
149
+ # # Install Caffe and OP dependencies
150
+ # install:
151
+ # - if [[ "$CI_OS_NAME" == "linux" ]]; then sudo bash scripts/CI/install_deps_ubuntu.sh ; fi
152
+ # - if [[ "$CI_OS_NAME" == "osx" ]]; then bash scripts/CI/install_deps_osx.sh ; fi
153
+ # - if [[ "$CI_OS_NAME" == "windows" ]]; then exit 99 ; fi
154
+
155
+ # # Running CMake
156
+ # before_script:
157
+ # - bash scripts/CI/configure.sh
158
+
159
+ # # Build your code e.g., by calling make
160
+ # script:
161
+ # - bash scripts/CI/run_make.sh
162
+ # - bash scripts/CI/run_tests.sh
.github/CI_deprecated/Readme_Travis_badges_table_and_backup_instructions.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ In order to recover Travis:
2
+ 1. Uncomment all the lines of code in ".travis.yml" and move it back to the main folder (e.g., at the same level than the global README.md and CMakeLists.txt files).
3
+ 2. Move `generate_gh_pages.sh` back to `scripts/generate_gh_pages.sh`.
4
+ 3. Re-add the table of badges in the README.md:
5
+
6
+ | |`Default Config` |`CUDA (+Python)` |`CPU (+Python)` |`OpenCL (+Python)`| `Debug` | `Unity` |
7
+ | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
8
+ | **`Linux`** | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/1)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/2)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/3)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/4)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/5)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/6)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
9
+ | **`MacOS`** | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/7)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/7)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/8)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/9)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/10)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) | [![Status](https://travis-matrix-badges.herokuapp.com/repos/CMU-Perceptual-Computing-Lab/openpose/branches/master/11)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose) |
10
+ | **`Windows`** | [![Status](https://ci.appveyor.com/api/projects/status/5leescxxdwen77kg/branch/master?svg=true)](https://ci.appveyor.com/project/gineshidalgo99/openpose/branch/master) | | | | |
11
+ <!--
12
+ Note: Currently using [travis-matrix-badges](https://github.com/bjfish/travis-matrix-badges) vs. traditional [![Build Status](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose.svg?branch=master)](https://travis-ci.org/CMU-Perceptual-Computing-Lab/openpose)
13
+ -->
.github/CI_deprecated/generate_gh_pages.sh ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ ################################################################################
3
+ # Title : generate_gh_pages.sh
4
+ # Date created : 2016/02/22
5
+ # Notes :
6
+ __AUTHOR__="openpose"
7
+ # Preconditions:
8
+ # - Packages doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
9
+ # must be installed.
10
+ # - Doxygen configuration file must have the destination directory empty and
11
+ # source code directory with a $(CI_BUILD_DIR) prefix.
12
+ # - An gh-pages branch should already exist. See below for more info on how to
13
+ # create a gh-pages branch.
14
+ #
15
+ # Required global variables:
16
+ # - CI_BUILD_NUMBER : The number of the current build.
17
+ # - CI_COMMIT : The commit that the current build is testing.
18
+ # - DOXYFILE : The Doxygen configuration file.
19
+ # - GH_REPO_NAME : The name of the repository.
20
+ # - GH_REPO_REF : The GitHub reference to the repository.
21
+ # - GH_REPO_TOKEN : Secure token to the github repository.
22
+ #
23
+ # For information on how to encrypt variables for Travis CI please go to
24
+ # https://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables
25
+ # or https://gist.github.com/vidavidorra/7ed6166a46c537d3cbd2
26
+ # For information on how to create a clean gh-pages branch from the master
27
+ # branch, please go to https://gist.github.com/vidavidorra/846a2fc7dd51f4fe56a0
28
+ #
29
+ # This script will generate Doxygen documentation and push the documentation to
30
+ # the gh-pages branch of a repository specified by GH_REPO_REF.
31
+ # Before this script is used there should already be a gh-pages branch in the
32
+ # repository.
33
+ #
34
+ ################################################################################
35
+
36
+ ################################################################################
37
+ ##### Setup this script and get the current gh-pages branch. #####
38
+ echo 'Setting up the script...'
39
+ # Exit with nonzero exit code if anything fails
40
+ set -e
41
+
42
+ # Create a clean working directory for this script.
43
+ mkdir code_docs
44
+ cd code_docs
45
+
46
+ # Get the current gh-pages branch
47
+ git clone -b gh-pages https://git@$GH_REPO_REF
48
+ cd $GH_REPO_NAME
49
+
50
+ ##### Configure git.
51
+ # Set the push default to simple i.e. push only the current branch.
52
+ git config --global push.default simple
53
+ # Pretend to be an user called Travis CI.
54
+ git config user.name "Travis CI"
55
+ git config user.email "travis@travis-ci.org"
56
+
57
+ # Remove everything currently in the gh-pages branch.
58
+ # GitHub is smart enough to know which files have changed and which files have
59
+ # stayed the same and will only update the changed files. So the gh-pages branch
60
+ # can be safely cleaned, and it is sure that everything pushed later is the new
61
+ # documentation.
62
+ rm -rf *
63
+
64
+ # Need to create a .nojekyll file to allow filenames starting with an underscore
65
+ # to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
66
+ # Presumably this is only needed when the SHORT_NAMES option in Doxygen is set
67
+ # to NO, which it is by default. So creating the file just in case.
68
+ echo "" > .nojekyll
69
+
70
+ ################################################################################
71
+ ##### Generate the Doxygen code documentation and log the output. #####
72
+ echo 'Generating Doxygen code documentation...'
73
+ # Redirect both stderr and stdout to the log file AND the console.
74
+ echo "OUTPUT_DIRECTORY = " >> $DOXYFILE
75
+ doxygen $DOXYFILE 2>&1 | tee doxygen.log
76
+
77
+ ################################################################################
78
+ ##### Upload the documentation to the gh-pages branch of the repository. #####
79
+ # Only upload if Doxygen successfully created the documentation.
80
+ # Check this by verifying that the html directory and the file html/index.html
81
+ # both exist. This is a good indication that Doxygen did it's work.
82
+ if [ -d "html" ] && [ -f "html/index.html" ]; then
83
+
84
+ echo 'Uploading documentation to the gh-pages branch...'
85
+ # Add everything in this directory (the Doxygen code documentation) to the
86
+ # gh-pages branch.
87
+ # GitHub is smart enough to know which files have changed and which files have
88
+ # stayed the same and will only update the changed files.
89
+ git add --all
90
+
91
+ # Commit the added files with a title and description containing the Travis CI
92
+ # build number and the GitHub commit reference that issued this build.
93
+ git commit -m "Deploy code docs to GitHub Pages Travis build: ${CI_BUILD_NUMBER}" -m "Commit: ${CI_COMMIT}"
94
+
95
+ # Force push to the remote gh-pages branch.
96
+ # The output is redirected to /dev/null to hide any sensitive credential data
97
+ # that might otherwise be exposed.
98
+ git push --force "https://${GH_REPO_TOKEN}@${GH_REPO_REF}" > /dev/null 2>&1
99
+ else
100
+ echo '' >&2
101
+ echo 'Warning: No documentation (html) files have been found!' >&2
102
+ echo 'Warning: Not going to push the documentation to GitHub!' >&2
103
+ exit 1
104
+ fi
.github/Logo_doxygen_black.png ADDED
.github/Logo_main_black.png ADDED
.github/issue_template.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Posting rules
2
+ 1. **No duplicated posts, only 1 new post opened a day, and up to 2 opened a week**. Otherwise, extrict user bans will occur.
3
+ - Check the [FAQ](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/05_faq.md) section, other GitHub issues, and general documentation before posting. E.g., **low-speed, out-of-memory, output format, 0-people detected, installation issues, ...**).
4
+ - Keep posting all your issues in the same post.
5
+ - No bans if you are unsure whether the post is duplicated!
6
+ 2. **Fill all** the **Your System Configuration section** if you are facing an error or unexpected behavior. Some posts (e.g., feature requests) might not require it.
7
+ 3. **No questions about training or 3rd party libraries**:
8
+ - OpenPose only implements testing. For training, check [OpenPose train](https://github.com/CMU-Perceptual-Computing-Lab/openpose_train).
9
+ - Caffe errors/issues: Check [Caffe](http://caffe.berkeleyvision.org) documentation.
10
+ - CUDA/cuDNN check failed errors: They are usually fixed by re-installing CUDA, then re-installing the proper cuDNN version, then rebooting, and then re-installing OpenPose. Otherwise, check Nvidia/CUDA/cuDNN forums.
11
+ - OpenCV errors: Install the default/pre-compiled OpenCV or check for OpenCV online help.
12
+ 4. Set a **proper issue title**: Add the OS (Ubuntu, Windows) and be specific (e.g., do not call it: `Error`).
13
+ 5. Only English comments.
14
+ 6. Remove these posting rules from your post but follow them!
15
+ Posts which do not follow these rules will be **ignored/deleted** and those **users banned** with no further clarification.
16
+
17
+
18
+
19
+ ### Issue Summary
20
+
21
+
22
+
23
+ ### Executed Command (if any)
24
+ Note: add `--logging_level 0 --disable_multi_thread` to get higher debug information.
25
+
26
+
27
+
28
+ ### OpenPose Output (if any)
29
+
30
+
31
+
32
+ ### Errors (if any)
33
+
34
+
35
+
36
+ ### Type of Issue
37
+ Select the topic(s) on your post, delete the rest:
38
+ - Compilation/installation error
39
+ - Execution error
40
+ - Help wanted
41
+ - Question
42
+ - Enhancement / offering possible extensions / pull request / etc
43
+ - Other (type your own type)
44
+
45
+
46
+
47
+ ### Your System Configuration
48
+ 1. **Whole console output** (if errors appeared), paste the error to [PasteBin](https://pastebin.com/) and then paste the link here: LINK
49
+
50
+ 2. **OpenPose version**: Latest GitHub code? Or specific commit (e.g., d52878f)? Or specific version from `Release` section (e.g., 1.2.0)?
51
+
52
+ 3. **General configuration**:
53
+ - **Installation mode**: CMake, sh script, manual Makefile installation, ... (Ubuntu); CMake, ... (Windows); ...?
54
+ - **Operating system** (`lsb_release -a` in Ubuntu):
55
+ - **Operating system version** (e.g., Ubuntu 16, Windows 10, ...):
56
+ - **Release or Debug mode**? (by default: release):
57
+ - Compiler (`gcc --version` in Ubuntu or VS version in Windows): 5.4.0, ... (Ubuntu); VS2015 Enterprise Update 3, VS2017 community, ... (Windows); ...?
58
+
59
+ 4. **Non-default settings**:
60
+ - **3-D Reconstruction module added**? (by default: no):
61
+ - Any other custom CMake configuration with respect to the default version? (by default: no):
62
+
63
+ 5. **3rd-party software**:
64
+ - **Caffe version**: Default from OpenPose, custom version, ...?
65
+ - **CMake version** (`cmake --version` in Ubuntu):
66
+ - **OpenCV version**: pre-compiled `apt-get install libopencv-dev` (only Ubuntu); OpenPose default (only Windows); compiled from source? If so, 2.4.9, 2.4.12, 3.1, 3.2?; ...?
67
+
68
+ 6. If **GPU mode** issue:
69
+ - **CUDA version** (`cat /usr/local/cuda/version.txt` in most cases):
70
+ - **cuDNN version**:
71
+ - **GPU model** (`nvidia-smi` in Ubuntu):
72
+
73
+ 7. If **CPU-only mode** issue:
74
+ - **CPU brand & model**:
75
+ - Total **RAM memory** available:
76
+
77
+ 8. If **Python** API:
78
+ - **Python version**: 2.7, 3.7, ...?
79
+ - **Numpy version** (`python -c "import numpy; print numpy.version.version"` in Ubuntu):
80
+
81
+ 9. If **Windows** system:
82
+ - Portable demo or compiled library?
83
+
84
+ 10. If **speed performance** issue:
85
+ - Report OpenPose timing speed based on the [profiling documentation](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/06_maximizing_openpose_speed.md#profiling-speed).
.github/media/body_heat_maps.png ADDED

Git LFS Details

  • SHA256: 11eed582d06c69f409e56c0ded335fd2fbd3d06228e7f5b3d2b1e8b3b105adba
  • Pointer size: 132 Bytes
  • Size of remote file: 2.43 MB
.github/media/dance_foot.gif ADDED

Git LFS Details

  • SHA256: 84db361692ac5835e695a6c971a61a119c3d426ff698db90dff2432546481fbb
  • Pointer size: 132 Bytes
  • Size of remote file: 4.41 MB
.github/media/installation/cmake_im_1.png ADDED
.github/media/installation/cmake_im_1_windows.png ADDED
.github/media/installation/cmake_im_2.png ADDED
.github/media/installation/cmake_im_2_windows.png ADDED
.github/media/installation/cmake_im_2_windows_new.png ADDED
.github/media/installation/cmake_im_3.png ADDED
.github/media/installation/cmake_im_3_windows.png ADDED
.github/media/installation/cmake_im_5.png ADDED
.github/media/keypoints_face.png ADDED
.github/media/keypoints_hand.odt ADDED
Binary file (137 kB). View file
 
.github/media/keypoints_hand.png ADDED
.github/media/keypoints_pose_18.png ADDED
.github/media/keypoints_pose_25.png ADDED
.github/media/openpose3d.gif ADDED
.github/media/openpose_vs_competition.png ADDED
.github/media/paf_heat_maps.png ADDED

Git LFS Details

  • SHA256: 976e86944144d90c6b18f4d61a05be0cacd8d71e9b1f002ff732761a96395788
  • Pointer size: 132 Bytes
  • Size of remote file: 1.89 MB
.github/media/pose_face.gif ADDED

Git LFS Details

  • SHA256: f2030331f4caae4a5c928227e01fb5c65183bba181c33867e87f942bc2b003b2
  • Pointer size: 132 Bytes
  • Size of remote file: 9.64 MB
.github/media/pose_face_hands.gif ADDED

Git LFS Details

  • SHA256: 5d2a3509ef791f7b08e751c6aea0287f4efab5ffbb0e6af7e335b5c50432b9a9
  • Pointer size: 132 Bytes
  • Size of remote file: 8.39 MB
.github/media/pose_hands.gif ADDED

Git LFS Details

  • SHA256: e369475240b3cbfe10436ebf7a4a5f1da1d10756ce95782891f839b0d2ff946c
  • Pointer size: 133 Bytes
  • Size of remote file: 10.7 MB
.github/media/shake.gif ADDED

Git LFS Details

  • SHA256: 6971f3331bf676f48174bb3358d43355a760bc53852b22ff67b2b7b0da6e7a43
  • Pointer size: 132 Bytes
  • Size of remote file: 2.04 MB
.github/media/unity_body_foot.png ADDED
.github/media/unity_hand_face.png ADDED
.github/media/unity_main.png ADDED
.github/root_index.html ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv = "refresh" content = "0; url = web/html/doc/index.html" />
5
+ </head>
6
+ <body>
7
+ </body>
8
+ </html>
.github/stale.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - bug/typo
8
+ - enhancement
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: stale/old
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
.github/workflows/main.yml ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ env:
6
+ GH_REPO_NAME: ${{ github.event.repository.name }}
7
+ DOXYFILE: ${{ github.workspace }}/.doc_autogeneration.doxygen
8
+ GH_REPO_REF: ${{ github.repositoryUrl }}
9
+
10
+ jobs:
11
+ build:
12
+ name: ${{ matrix.env.NAME }}
13
+ runs-on: ${{ matrix.os }}
14
+ env: ${{ matrix.env }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ # Ubuntu
20
+ # Ubuntu 20.04 - Default - CMake - CUDA
21
+ - os: ubuntu-20.04
22
+ os_name: linux
23
+ env:
24
+ NAME: U20-default-cmake-cuda
25
+ WITH_CUDNN: false
26
+ CI_OS_NAME: linux
27
+ # Ubuntu 18.04 - Default - CMake - CUDA
28
+ - os: ubuntu-18.04
29
+ os_name: linux
30
+ env:
31
+ NAME: U18-default-cmake-cuda
32
+ WITH_CUDNN: false
33
+ CI_OS_NAME: linux
34
+ # Ubuntu 20.04 - Python - CMake - CUDA
35
+ - os: ubuntu-20.04
36
+ os_name: linux
37
+ env:
38
+ NAME: U20-python-cmake-cuda
39
+ WITH_CUDNN: false
40
+ WITH_PYTHON: true
41
+ CI_OS_NAME: linux
42
+ CI_BUILD_NUMBER: ${{ github.run_number }}
43
+ CI_COMMIT: ${{ github.sha }}
44
+ PYTHON3_VERSION: python3.8
45
+ DOCS: true
46
+ # Ubuntu 18.04 - Python - CMake - CUDA
47
+ - os: ubuntu-18.04
48
+ os_name: linux
49
+ env:
50
+ NAME: U18-python-cmake-cuda
51
+ WITH_CUDNN: false
52
+ WITH_PYTHON: true
53
+ CI_OS_NAME: linux
54
+ # Ubuntu 20.04 - Python - CMake - CPU
55
+ - os: ubuntu-20.04
56
+ os_name: linux
57
+ env:
58
+ NAME: U20-python-cmake-cpu
59
+ WITH_PYTHON: true
60
+ WITH_CUDA: false
61
+ WITH_CUDNN: false
62
+ CI_OS_NAME: linux
63
+ PYTHON3_VERSION: python3.8
64
+ # Ubuntu 18.04 - Python - CMake - CPU
65
+ - os: ubuntu-18.04
66
+ os_name: linux
67
+ env:
68
+ NAME: U18-python-cmake-cpu
69
+ WITH_PYTHON: true
70
+ WITH_CUDA: false
71
+ WITH_CUDNN: false
72
+ CI_OS_NAME: linux
73
+ # TO-DO (not passing)
74
+ # # Ubuntu 20.04 - Python - CMake - OpenCL
75
+ # - os: ubuntu-20.04
76
+ # os_name: linux
77
+ # env:
78
+ # NAME: U20-python-cmake-opencl
79
+ # WITH_PYTHON: true
80
+ # WITH_CUDA: false
81
+ # WITH_CUDNN: false
82
+ # WITH_OPEN_CL: true
83
+ # CI_OS_NAME: linux
84
+ # PYTHON3_VERSION: python3.8
85
+ # Ubuntu 18.04 - Python - CMake - OpenCL
86
+ - os: ubuntu-18.04
87
+ os_name: linux
88
+ env:
89
+ NAME: U18-python-cmake-opencl
90
+ WITH_PYTHON: true
91
+ WITH_CUDA: false
92
+ WITH_CUDNN: false
93
+ WITH_OPEN_CL: true
94
+ CI_OS_NAME: linux
95
+ # Ubuntu 20.04 - Python - CMake - CPU - Debug
96
+ - os: ubuntu-20.04
97
+ os_name: linux
98
+ env:
99
+ NAME: U20-python-cmake-cpu-debug
100
+ WITH_PYTHON: true
101
+ WITH_CUDA: false
102
+ WITH_CUDNN: false
103
+ WITH_DEBUG: true
104
+ CI_OS_NAME: linux
105
+ PYTHON3_VERSION: python3.8
106
+ # Ubuntu 18.04 - Python - CMake - CPU - Debug
107
+ - os: ubuntu-18.04
108
+ os_name: linux
109
+ env:
110
+ NAME: U18-python-cmake-cpu-debug
111
+ WITH_PYTHON: true
112
+ WITH_CUDA: false
113
+ WITH_CUDNN: false
114
+ WITH_DEBUG: true
115
+ CI_OS_NAME: linux
116
+ # Ubuntu 20.04 - Python - CMake - CPU - Unity
117
+ - os: ubuntu-20.04
118
+ os_name: linux
119
+ env:
120
+ NAME: U20-python-cmake-cpu-unity
121
+ WITH_PYTHON: true
122
+ WITH_UNITY: true
123
+ WITH_CUDA: false
124
+ WITH_CUDNN: false
125
+ CI_OS_NAME: linux
126
+ PYTHON3_VERSION: python3.8
127
+ # Ubuntu 20.04 - Default - CMake - CPU
128
+ - os: ubuntu-20.04
129
+ os_name: linux
130
+ env:
131
+ NAME: U20-default-cmake-cpu
132
+ WITH_CUDA: false
133
+ WITH_CUDNN: false
134
+ CI_OS_NAME: linux
135
+
136
+ # Mac OSX
137
+ # Mac OSX - Python - CMake - CPU
138
+ - os: macos-10.15
139
+ os_name: osx
140
+ env:
141
+ NAME: OSX-python-cmake-cpu
142
+ WITH_CUDA: false
143
+ WITH_CUDNN: false
144
+ WITH_PYTHON: true
145
+ CI_OS_NAME: osx
146
+ # Mac OSX - Python - CMake - OpenCL
147
+ - os: macos-10.15
148
+ os_name: osx
149
+ env:
150
+ NAME: OSX-default-cmake-opencl
151
+ WITH_CUDA: false
152
+ WITH_CUDNN: false
153
+ WITH_OPEN_CL: true
154
+ CI_OS_NAME: osx
155
+ # Mac OSX - Python - CMake - CPU - Debug
156
+ - os: macos-10.15
157
+ os_name: osx
158
+ env:
159
+ NAME: OSX-python-cmake-cpu-debug
160
+ WITH_CUDA: false
161
+ WITH_CUDNN: false
162
+ WITH_PYTHON: true
163
+ WITH_DEBUG: true
164
+ CI_OS_NAME: osx
165
+ # Mac OSX - Python - CMake - CPU - Unity
166
+ - os: macos-10.15
167
+ os_name: osx
168
+ env:
169
+ NAME: OSX-python-cmake-cpu-unity
170
+ WITH_CUDA: false
171
+ WITH_CUDNN: false
172
+ WITH_PYTHON: true
173
+ WITH_UNITY: true
174
+ CI_OS_NAME: osx
175
+ # Mac OSX - Default - CMake - CPU
176
+ - os: macos-10.15
177
+ os_name: osx
178
+ env:
179
+ NAME: OSX-default-cmake-cpu
180
+ WITH_CUDA: false
181
+ WITH_CUDNN: false
182
+ CI_OS_NAME: osx
183
+
184
+ # TO-DO (not passing)
185
+ # Note: CUDA jobs fail in U16 because of an issue with GCC 5.5 (https://github.com/NVIDIA/apex/issues/529). GH Actions doesn't support
186
+ # GCC 5.4 and CUDA does not support newer than GCC 5.X. Thus, cuDNN (sh file only for Ubuntu 16) is no longer tested.
187
+ # # Ubuntu 16.04
188
+ # # Ubuntu 16.04 - Default - CMake - CUDA
189
+ # - os: ubuntu-16.04
190
+ # os_name: linux
191
+ # env:
192
+ # NAME: U16-default-cmake-cuda8
193
+ # CI_OS_NAME: linux
194
+
195
+ # # Deprecated (not working for the above issue between CUDA and the Ubuntu16 from GitHub Actions)
196
+ # # Ubuntu 16.04 - Default - Make - CUDA
197
+ # - os: ubuntu-16.04
198
+ # os_name: linux
199
+ # env:
200
+ # NAME: U16-default-make-cuda
201
+ # WITH_CUDNN: false
202
+ # WITH_CMAKE: false
203
+ # CI_OS_NAME: linux
204
+
205
+ # Ubuntu 16 no longer works
206
+ # # Ubuntu 16.04 - Python - CMake - CPU
207
+ # - os: ubuntu-16.04
208
+ # os_name: linux
209
+ # env:
210
+ # NAME: U16-python-cmake-cpu
211
+ # WITH_PYTHON: true
212
+ # WITH_CUDA: false
213
+ # WITH_CUDNN: false
214
+ # CI_OS_NAME: linux
215
+ # # Ubuntu 16.04 - Python - CMake - OpenCL
216
+ # - os: ubuntu-16.04
217
+ # os_name: linux
218
+ # env:
219
+ # NAME: U16-python-cmake-opencl
220
+ # WITH_PYTHON: true
221
+ # WITH_CUDA: false
222
+ # WITH_CUDNN: false
223
+ # WITH_OPEN_CL: true
224
+ # CI_OS_NAME: linux
225
+ # # Ubuntu 16.04 - Python - CMake - CPU - Debug
226
+ # - os: ubuntu-16.04
227
+ # os_name: linux
228
+ # env:
229
+ # NAME: U16-python-cmake-cpu-debug
230
+ # WITH_PYTHON: true
231
+ # WITH_CUDA: false
232
+ # WITH_CUDNN: false
233
+ # WITH_DEBUG: true
234
+ # CI_OS_NAME: linux
235
+
236
+ steps:
237
+ - uses: actions/checkout@v2
238
+ with:
239
+ fetch-depth: 0
240
+ submodules: recursive
241
+ - uses: actions/setup-python@v2
242
+ with:
243
+ python-version: 2.x
244
+ if: ${{ matrix.env.WITH_PYTHON }}
245
+ - name: Install (Linux)
246
+ run: scripts/CI/install_deps_ubuntu.sh
247
+ if: ${{ matrix.os_name == 'linux' }}
248
+ - name: Install (Mac OS)
249
+ run: scripts/CI/install_deps_osx.sh
250
+ if: ${{ matrix.os_name == 'osx' }}
251
+
252
+ - name: Configure
253
+ run: scripts/CI/configure.sh
254
+ - name: Make
255
+ run: scripts/CI/run_make.sh
256
+ - name: Tests
257
+ run: scripts/CI/run_tests.sh
258
+
259
+ - name: Docs APT packages
260
+ run: |
261
+ # The Doxygen apt-get version for Ubuntu 20 is 1.8.17, which has some bugs fixed in 1.9.1
262
+ # run: sudo apt-get -yq install doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
263
+ git clone https://github.com/doxygen/doxygen.git && cd doxygen && git checkout Release_1_9_1
264
+ mkdir build && cd build
265
+ cmake -G "Unix Makefiles" ..
266
+ make -j`nproc`
267
+ sudo make install
268
+ if: ${{ matrix.DOCS }}
269
+ - name: Generate docs
270
+ run: |
271
+ cd ${{ github.workspace }}
272
+ echo 'Generating Doxygen code documentation...'
273
+ doxygen $DOXYFILE 2>&1 | tee doxygen.log
274
+ # Required so Doxygen links/finds the license file
275
+ cp LICENSE doxygen/html/LICENSE
276
+ # Required in order to link .github/media/ images with doc without modifying doc links. Remove if using `publish_dir: doxygen/html/`
277
+ mkdir -p doxygen_final/web/html/ && mv doxygen/html doxygen_final/web/html/doc
278
+ mkdir -p doxygen_final/web/.github/media/ && cp -rf .github/media/ doxygen_final/web/.github/
279
+ mkdir -p doxygen_final/web/html/.github/media/ && cp -rf .github/media/ doxygen_final/web/html/.github/
280
+ mkdir -p doxygen_final/web/html/doc/.github/media/ && cp -rf .github/media/ doxygen_final/web/html/doc/.github/
281
+ echo 'Copying log...'
282
+ cp doxygen.log doxygen_final/doxygen.log
283
+ echo 'Copying index.html to root pointing to actual docs'
284
+ cp .github/root_index.html doxygen_final/index.html
285
+ if: ${{ matrix.DOCS }}
286
+ - name: Deploy Docs
287
+ uses: peaceiris/actions-gh-pages@v3
288
+ with:
289
+ github_token: ${{ secrets.GITHUB_TOKEN }}
290
+ publish_dir: doxygen_final/
291
+ # publish_dir: doxygen/html/ # Original one, it would turn [...].github.io/openpose/web/html/doc/ into [...].github.io/openpose/, but images would not work
292
+ destination_dir: .
293
+ enable_jekyll: false
294
+ force_orphan: true
295
+ if: ${{ matrix.DOCS && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
.gitignore ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ######################### Binary Files #########################
2
+ # Compiled Object files
3
+ *.slo
4
+ *.lo
5
+ *.o
6
+ *.cuo
7
+
8
+ # Compiled Dynamic libraries
9
+ *.so*
10
+ *.dylib
11
+
12
+ # Compiled Static libraries
13
+ *.lai
14
+ *.la
15
+ *.a
16
+
17
+ # Compiled protocol buffers
18
+ *.pb.h
19
+ *.pb.cc
20
+ *_pb2.py
21
+
22
+ # Compiled python
23
+ *.pyc
24
+
25
+ # Compiled MATLAB
26
+ *.mex*
27
+
28
+ # IPython notebook checkpoints
29
+ .ipynb_checkpoints
30
+
31
+ # LevelDB files
32
+ *.sst
33
+ *.ldb
34
+ LOCK
35
+ CURRENT
36
+ MANIFEST-*
37
+
38
+ ######################### IDEs Files #########################
39
+ # Editor temporaries
40
+ *.swp
41
+ *~
42
+
43
+ # Sublime Text settings
44
+ *.sublime-workspace
45
+ *.sublime-project
46
+
47
+ # Eclipse Project settings
48
+ *.*project
49
+ .settings
50
+
51
+ # QtCreator files
52
+ *.user
53
+
54
+ # PyCharm files
55
+ .idea
56
+
57
+ # OSX dir files
58
+ .DS_Store
59
+ ._.DS_Store
60
+
61
+ # Vim files
62
+ cscope.*
63
+ tags
64
+ .clang_complete
65
+ .vim
66
+
67
+ ######################### Windows (Visual Studio) Files #########################
68
+ *.db
69
+ *.deps
70
+ *.obj
71
+ *.opendb
72
+ *.pdb
73
+
74
+ ######################### Windows (Visual Studio) Folders and Compressed files #########################
75
+ *.vs/
76
+ *x64/
77
+ # Allowing this file (removed *.user for Qt)
78
+ !*.vcxproj.user
79
+
80
+ ######################### Caffe Files / Folders #########################
81
+ # User's build configuration
82
+ Makefile
83
+ Makefile.config
84
+
85
+ # Data and models are either
86
+ # 1. reference, and not casually committed
87
+ # 2. custom, and live on their own unless they're deliberated contributed
88
+ distribute/
89
+ *.caffemodel
90
+ *.caffemodel.h5
91
+ *.solverstate
92
+ *.solverstate.h5
93
+ *.binaryproto
94
+ *leveldb
95
+ *lmdb
96
+
97
+ # Camera parameters
98
+ *.xml
99
+
100
+ ######################### 3rd-party Folders and Zip Files #########################
101
+ 3rdparty/caffe/.git
102
+ 3rdparty/caffe/.github
103
+ 3rdparty/asio/
104
+ 3rdparty/eigen/
105
+ 3rdparty/windows/caffe/
106
+ 3rdparty/windows/caffe_cpu/
107
+ 3rdparty/windows/caffe_opencl/
108
+ 3rdparty/windows/caffe3rdparty/
109
+ 3rdparty/windows/opencv/
110
+ 3rdparty/windows/freeglut/
111
+ 3rdparty/windows/spinnaker/
112
+ 3rdparty/*zip
113
+ 3rdparty/windows/*zip
114
+
115
+ ######################### Compilation (build, distribute & bins) Files / Folders #########################
116
+ *.bin
117
+ *.testbin
118
+ build
119
+ build*
120
+ .build*
121
+ *cmake_build
122
+ distribute/*
123
+ python/caffe/proto/
124
+
125
+ ######################### Generated Documentation #########################
126
+ _site
127
+ docs/_site
128
+ docs/dev
129
+ docs/gathered
130
+ doxygen
131
+ html/
132
+
133
+ ######################### Video Files #########################
134
+ # Testing videos
135
+ *.mp4
136
+ *.mov
137
+
138
+ ######################### Validation Scripts & Testing #########################
139
+ output*/
.gitmodules ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ [submodule "3rdparty/caffe"]
2
+ path = 3rdparty/caffe
3
+ url = https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
4
+ [submodule "3rdparty/pybind11"]
5
+ path = 3rdparty/pybind11
6
+ url = https://github.com/pybind/pybind11.git
3rdparty/Versions.txt ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Asio:
2
+ - Version 1.12.1.
3
+ - Link: https://think-async.com/Asio/Download
4
+
5
+ Eigen:
6
+ - Version 3.3.8
7
+ - Link: http://eigen.tuxfamily.org/index.php
8
+
9
+ Unix:
10
+ - Caffe:
11
+ - Version 1.0.0, extracted from GitHub from its master branch.
12
+ - Link: https://github.com/BVLC/caffe
13
+ - GitHub SHA: 864520713a4c5ffae7382ced5d34e4cadc608473
14
+
15
+ - Spinnaker:
16
+ - Tested on Spinnaker 1.13.0.31 SDK - Linux Ubuntu 16.04 (64-bit) - 05/25/2018 - 41.580MB.
17
+ - Prerequisites: https://www.ptgrey.com/tan/10685
18
+
19
+ Windows:
20
+ - Caffe & Caffe dependencies (caffe3rdparty):
21
+ - Version 1.0.0, extracted from GitHub from its master branch.
22
+ - Link: https://github.com/BVLC/caffe/tree/windows
23
+
24
+ - FreeGLUT (only for the 3-D reconstruction demo):
25
+ - Version 3.0.0-2 (MSVC), extracted from their oficial website.
26
+ - Link: https://www.transmissionzero.co.uk/software/freeglut-devel/
27
+
28
+ - OpenCV:
29
+ - Version 4.5.0, extracted from their oficial website: section `Releases`, subsection `OpenCV - 4.5.0`, `Windows` version.
30
+ - Link: https://opencv.org/releases/
31
+
32
+ - Unzip:
33
+ - Version 5.52.
34
+ - Link: http://stahlworks.com/dev/?tool=zipunzip
35
+
36
+ - Wget:
37
+ - Version wget-1.20.3-win64.
38
+ - Link: https://eternallybored.org/misc/wget/
3rdparty/caffe/.Doxyfile ADDED
The diff for this file is too large to render. See raw diff
 
3rdparty/caffe/.github/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Important - read before submitting
2
+
3
+ *Please read the [guidelines for contributing](https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md) before submitting this issue!*
4
+
5
+ *Please do not post installation, build, usage, or modeling questions, or other requests for help to Issues.*
6
+ Use the [caffe-users list](https://groups.google.com/forum/#!forum/caffe-users) instead.
7
+ This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.
8
+
9
+ ### Issue summary
10
+
11
+
12
+ ### Steps to reproduce
13
+
14
+
15
+ ### Tried solutions
16
+
17
+
18
+ ### System configuration
19
+
20
+ * Operating system:
21
+ * Compiler:
22
+ * CUDA version (if applicable):
23
+ * CUDNN version (if applicable):
24
+ * BLAS:
25
+ * Python version (if using pycaffe):
26
+ * MATLAB version (if using matcaffe):
27
+
28
+ ### Issue checklist
29
+
30
+ - [ ] read the guidelines and removed the first paragraph
31
+ - [ ] written a short summary and detailed steps to reproduce
32
+ - [ ] explained how solutions to related problems failed (tick if found none)
33
+ - [ ] filled system configuration
34
+ - [ ] attached relevant logs/config files (tick if not applicable)
3rdparty/caffe/.gitignore ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## General
2
+
3
+ # Compiled Object files
4
+ *.slo
5
+ *.lo
6
+ *.o
7
+ *.cuo
8
+
9
+ # Compiled Dynamic libraries
10
+ *.so
11
+ *.dylib
12
+
13
+ # Compiled Static libraries
14
+ *.lai
15
+ *.la
16
+ *.a
17
+
18
+ # Compiled protocol buffers
19
+ *.pb.h
20
+ *.pb.cc
21
+ *_pb2.py
22
+
23
+ # Compiled python
24
+ *.pyc
25
+
26
+ # Compiled MATLAB
27
+ *.mex*
28
+
29
+ # IPython notebook checkpoints
30
+ .ipynb_checkpoints
31
+
32
+ # Editor temporaries
33
+ *.swp
34
+ *~
35
+
36
+ # Sublime Text settings
37
+ *.sublime-workspace
38
+ *.sublime-project
39
+
40
+ # Eclipse Project settings
41
+ *.*project
42
+ .settings
43
+
44
+ # QtCreator files
45
+ *.user
46
+
47
+ # PyCharm files
48
+ .idea
49
+
50
+ # Visual Studio Code files
51
+ .vscode
52
+
53
+ # OSX dir files
54
+ .DS_Store
55
+
56
+ ## Caffe
57
+
58
+ # User's build configuration
59
+ Makefile.config
60
+
61
+ # Data and models are either
62
+ # 1. reference, and not casually committed
63
+ # 2. custom, and live on their own unless they're deliberated contributed
64
+ data/*
65
+ models/*
66
+ *.caffemodel
67
+ *.caffemodel.h5
68
+ *.solverstate
69
+ *.solverstate.h5
70
+ *.binaryproto
71
+ *leveldb
72
+ *lmdb
73
+
74
+ # build, distribute, and bins (+ python proto bindings)
75
+ build
76
+ .build_debug/*
77
+ .build_release/*
78
+ distribute/*
79
+ *.testbin
80
+ *.bin
81
+ python/caffe/proto/
82
+ cmake_build
83
+ .cmake_build
84
+
85
+ # Generated documentation
86
+ docs/_site
87
+ docs/_includes
88
+ docs/gathered
89
+ _site
90
+ doxygen
91
+ docs/dev
92
+
93
+ # LevelDB files
94
+ *.sst
95
+ *.ldb
96
+ LOCK
97
+ LOG*
98
+ CURRENT
99
+ MANIFEST-*
3rdparty/caffe/.travis.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dist: trusty
2
+ sudo: required
3
+
4
+ language: cpp
5
+ compiler: gcc
6
+
7
+ env:
8
+ global:
9
+ - NUM_THREADS=4
10
+ matrix:
11
+ # Use a build matrix to test many builds in parallel
12
+ # envvar defaults:
13
+ # WITH_CMAKE: false
14
+ # WITH_PYTHON3: false
15
+ # WITH_IO: true
16
+ # WITH_CUDA: false
17
+ # WITH_CUDNN: false
18
+ - BUILD_NAME="default-make"
19
+ # - BUILD_NAME="python3-make" WITH_PYTHON3=true
20
+ - BUILD_NAME="no-io-make" WITH_IO=false
21
+ - BUILD_NAME="cuda-make" WITH_CUDA=true
22
+ - BUILD_NAME="cudnn-make" WITH_CUDA=true WITH_CUDNN=true
23
+
24
+ - BUILD_NAME="default-cmake" WITH_CMAKE=true
25
+ - BUILD_NAME="python3-cmake" WITH_CMAKE=true WITH_PYTHON3=true
26
+ - BUILD_NAME="no-io-cmake" WITH_CMAKE=true WITH_IO=false
27
+ - BUILD_NAME="cuda-cmake" WITH_CMAKE=true WITH_CUDA=true
28
+ - BUILD_NAME="cudnn-cmake" WITH_CMAKE=true WITH_CUDA=true WITH_CUDNN=true
29
+
30
+ cache:
31
+ apt: true
32
+ directories:
33
+ - ~/protobuf3
34
+
35
+ before_install:
36
+ - source ./scripts/travis/defaults.sh
37
+
38
+ install:
39
+ - sudo -E ./scripts/travis/install-deps.sh
40
+ - ./scripts/travis/setup-venv.sh ~/venv
41
+ - source ~/venv/bin/activate
42
+ - ./scripts/travis/install-python-deps.sh
43
+
44
+ before_script:
45
+ - ./scripts/travis/configure.sh
46
+
47
+ script:
48
+ - ./scripts/travis/build.sh
49
+ - ./scripts/travis/test.sh
50
+
51
+ notifications:
52
+ # Emails are sent to the committer's git-configured email address by default,
53
+ # but only if they have access to the repository. To enable Travis on your
54
+ # public fork of Caffe, just go to travis-ci.org and flip the switch on for
55
+ # your Caffe fork. To configure your git email address, use:
56
+ # git config --global user.email me@example.com
57
+ email:
58
+ on_success: always
59
+ on_failure: always
60
+
61
+ # IRC notifications disabled by default.
62
+ # Uncomment next 5 lines to send notifications to chat.freenode.net#caffe
63
+ # irc:
64
+ # channels:
65
+ # - "chat.freenode.net#caffe"
66
+ # template:
67
+ # - "%{repository}/%{branch} (%{commit} - %{author}): %{message}"
3rdparty/caffe/CMakeLists.txt ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 2.8.7)
2
+ if(POLICY CMP0046)
3
+ cmake_policy(SET CMP0046 NEW)
4
+ endif()
5
+ if(POLICY CMP0054)
6
+ cmake_policy(SET CMP0054 NEW)
7
+ endif()
8
+
9
+ # ---[ Caffe project
10
+ project(Caffe C CXX)
11
+
12
+ # ---[ Caffe version
13
+ set(CAFFE_TARGET_VERSION "1.0.0" CACHE STRING "Caffe logical version")
14
+ set(CAFFE_TARGET_SOVERSION "1.0.0" CACHE STRING "Caffe soname version")
15
+ add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION})
16
+
17
+ # ---[ Using cmake scripts and modules
18
+ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
19
+
20
+ include(ExternalProject)
21
+ include(GNUInstallDirs)
22
+
23
+ include(cmake/Utils.cmake)
24
+ include(cmake/Targets.cmake)
25
+ include(cmake/Misc.cmake)
26
+ include(cmake/Summary.cmake)
27
+ include(cmake/ConfigGen.cmake)
28
+
29
+ # ---[ Options
30
+ caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA
31
+ caffe_option(USE_CUDNN "Build Caffe with cuDNN library support" ON IF NOT CPU_ONLY)
32
+ caffe_option(USE_NCCL "Build Caffe with NCCL library support" OFF)
33
+ caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
34
+ caffe_option(BUILD_python "Build Python wrapper" ON)
35
+ set(python_version "2" CACHE STRING "Specify which Python version to use")
36
+ caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
37
+ caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
38
+ caffe_option(BUILD_python_layer "Build the Caffe Python layer" ON)
39
+ caffe_option(USE_OPENCV "Build with OpenCV support" ON)
40
+ caffe_option(USE_LEVELDB "Build with levelDB" ON)
41
+ caffe_option(USE_LMDB "Build with lmdb" ON)
42
+ caffe_option(ALLOW_LMDB_NOLOCK "Allow MDB_NOLOCK when reading LMDB files (only if necessary)" OFF)
43
+ caffe_option(USE_OPENMP "Link with OpenMP (when your BLAS wants OpenMP and you get linker errors)" OFF)
44
+
45
+ # This code is taken from https://github.com/sh1r0/caffe-android-lib
46
+ caffe_option(USE_HDF5 "Build with hdf5" ON)
47
+
48
+ # ---[ Dependencies
49
+ include(cmake/Dependencies.cmake)
50
+
51
+ # ---[ Flags
52
+ if(UNIX OR APPLE)
53
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11")
54
+ endif()
55
+
56
+ caffe_set_caffe_link()
57
+
58
+ if(USE_libstdcpp)
59
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
60
+ message("-- Warning: forcing libstdc++ (controlled by USE_libstdcpp option in cmake)")
61
+ endif()
62
+
63
+ # ---[ Warnings
64
+ caffe_warnings_disable(CMAKE_CXX_FLAGS -Wno-sign-compare -Wno-uninitialized)
65
+
66
+ # ---[ Config generation
67
+ configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_config.h")
68
+
69
+ # ---[ Includes
70
+ set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
71
+ set(Caffe_SRC_DIR ${PROJECT_SOURCE_DIR}/src)
72
+ include_directories(${PROJECT_BINARY_DIR})
73
+
74
+ # ---[ Includes & defines for CUDA
75
+
76
+ # cuda_compile() does not have per-call dependencies or include pathes
77
+ # (cuda_compile() has per-call flags, but we set them here too for clarity)
78
+ #
79
+ # list(REMOVE_ITEM ...) invocations remove PRIVATE and PUBLIC keywords from collected definitions and include pathes
80
+ if(HAVE_CUDA)
81
+ # pass include pathes to cuda_include_directories()
82
+ set(Caffe_ALL_INCLUDE_DIRS ${Caffe_INCLUDE_DIRS})
83
+ list(REMOVE_ITEM Caffe_ALL_INCLUDE_DIRS PRIVATE PUBLIC)
84
+ cuda_include_directories(${Caffe_INCLUDE_DIR} ${Caffe_SRC_DIR} ${Caffe_ALL_INCLUDE_DIRS})
85
+
86
+ # add definitions to nvcc flags directly
87
+ if(Caffe_DEFINITIONS)
88
+ set(Caffe_ALL_DEFINITIONS ${Caffe_DEFINITIONS})
89
+ list(REMOVE_ITEM Caffe_ALL_DEFINITIONS PRIVATE PUBLIC)
90
+ list(APPEND CUDA_NVCC_FLAGS ${Caffe_ALL_DEFINITIONS})
91
+ endif()
92
+ endif()
93
+
94
+ # ---[ Subdirectories
95
+ add_subdirectory(src/gtest)
96
+ add_subdirectory(src/caffe)
97
+ add_subdirectory(tools)
98
+ add_subdirectory(examples)
99
+ add_subdirectory(python)
100
+ add_subdirectory(matlab)
101
+ add_subdirectory(docs)
102
+
103
+ # ---[ Linter target
104
+ add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)
105
+
106
+ # ---[ pytest target
107
+ if(BUILD_python)
108
+ add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
109
+ add_dependencies(pytest pycaffe)
110
+ endif()
111
+
112
+ # ---[ uninstall target
113
+ configure_file(
114
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake.in
115
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/Uninstall.cmake
116
+ IMMEDIATE @ONLY)
117
+
118
+ add_custom_target(uninstall
119
+ COMMAND ${CMAKE_COMMAND} -P
120
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/Uninstall.cmake)
121
+
122
+ # ---[ Configuration summary
123
+ caffe_print_configuration_summary()
124
+
125
+ # ---[ Export configs generation
126
+ caffe_generate_export_configs()
127
+
3rdparty/caffe/CONTRIBUTING.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing
2
+
3
+ Below you will find a collection of guidelines for submitting issues as well as contributing code to the Caffe repository.
4
+ Please read those before starting an issue or a pull request.
5
+
6
+ ## Issues
7
+
8
+ Specific Caffe design and development issues, bugs, and feature requests are maintained by GitHub Issues.
9
+
10
+ *Please do not post installation, build, usage, or modeling questions, or other requests for help to Issues.*
11
+ Use the [caffe-users list](https://groups.google.com/forum/#!forum/caffe-users) instead.
12
+ This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.
13
+ See the chapter [caffe-users](#caffe-users) below for guidance on posting to the users list.
14
+
15
+ When reporting an issue, it's most helpful to provide the following information, where applicable:
16
+ * How does the problem look like and what steps reproduce it?
17
+ * Can you reproduce it using the latest [master](https://github.com/BVLC/caffe/tree/master), compiled with the `DEBUG` make option?
18
+ * What hardware and software are you running? In particular:
19
+ * GPU make and model, if relevant,
20
+ * operating system/distribution,
21
+ * compiler; please also post which version (for example, with GCC run `gcc --version` to check),
22
+ * CUDA version, if applicable (run `nvcc --version` to check),
23
+ * cuDNN version, if applicable (version number is stored in `cudnn.h`, look for lines containing `CUDNN_MAJOR`, `CUDNN_MINOR` and `CUDNN_PATCHLEVEL`),
24
+ * BLAS library,
25
+ * Python version, if relevant,
26
+ * MATLAB version, if relevant.
27
+ * **What have you already tried** to solve the problem? How did it fail? Are there any other issues related to yours?
28
+ * If this is not a build-related issue, does your installation pass `make runtest`?
29
+ * If the bug is a crash, provide the backtrace (usually printed by Caffe; always obtainable with `gdb`).
30
+ * If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.
31
+
32
+ If only a small portion of the code/log is relevant to your issue, you may paste it directly into the post, preferably using Markdown syntax for code block: triple backtick ( \`\`\` ) to open/close a block.
33
+ In other cases (multiple files, or long files), please **attach** them to the post - this greatly improves readability.
34
+
35
+ If the problem arises during a complex operation (e.g. large script using pycaffe, long network prototxt), please reduce the example to the minimal size that still causes the error.
36
+ Also, minimize influence of external modules, data etc. - this way it will be easier for others to understand and reproduce your issue, and eventually help you.
37
+ Sometimes you will find the root cause yourself in the process.
38
+
39
+ Try to give your issue a title that is succinct and specific. The devs will rename issues as needed to keep track of them.
40
+
41
+ ## Caffe-users
42
+
43
+ Before you post to the [caffe-users list](https://groups.google.com/forum/#!forum/caffe-users), make sure you look for existing solutions.
44
+ The Caffe community has encountered and found solutions to countless problems - benefit from the collective experience.
45
+ Recommended places to look:
46
+ * the [users list](https://groups.google.com/forum/#!forum/caffe-users) itself,
47
+ * [`caffe`](https://stackoverflow.com/questions/tagged/caffe) tag on StackOverflow,
48
+ * [GitHub issues](https://github.com/BVLC/caffe/issues) tracker (some problems have been answered there),
49
+ * the public [wiki](https://github.com/BVLC/caffe/wiki),
50
+ * the official [documentation](http://caffe.berkeleyvision.org/).
51
+
52
+ Found a post/issue with your exact problem, but with no answer?
53
+ Don't just leave a "me too" message - provide the details of your case.
54
+ Problems with more available information are easier to solve and attract good attention.
55
+
56
+ When posting to the list, make sure you provide as much relevant information as possible - recommendations for an issue report (see above) are a good starting point.
57
+ *Please make it very clear which version of Caffe you are using, especially if it is a fork not maintained by BVLC.*
58
+
59
+ Formatting recommendations hold: paste short logs/code fragments into the post (use fixed-width text for them), **attach** long logs or multiple files.
60
+
61
+ ## Pull Requests
62
+
63
+ Caffe welcomes all contributions.
64
+
65
+ See the [contributing guide](http://caffe.berkeleyvision.org/development.html) for details.
66
+
67
+ Briefly: read commit by commit, a PR should tell a clean, compelling story of _one_ improvement to Caffe. In particular:
68
+
69
+ * A PR should do one clear thing that obviously improves Caffe, and nothing more. Making many smaller PRs is better than making one large PR; review effort is superlinear in the amount of code involved.
70
+ * Similarly, each commit should be a small, atomic change representing one step in development. PRs should be made of many commits where appropriate.
71
+ * Please do rewrite PR history to be clean rather than chronological. Within-PR bugfixes, style cleanups, reversions, etc. should be squashed and should not appear in merged PR history.
72
+ * Anything nonobvious from the code should be explained in comments, commit messages, or the PR description, as appropriate.
3rdparty/caffe/CONTRIBUTORS.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributors
2
+
3
+ Caffe is developed by a core set of BAIR members and the open-source community.
4
+
5
+ We thank all of our [contributors](https://github.com/BVLC/caffe/graphs/contributors)!
6
+
7
+ **For the detailed history of contributions** of a given file, try
8
+
9
+ git blame file
10
+
11
+ to see line-by-line credits and
12
+
13
+ git log --follow file
14
+
15
+ to see the change log even across renames and rewrites.
16
+
17
+ Please refer to the [acknowledgements](http://caffe.berkeleyvision.org/#acknowledgements) on the Caffe site for further details.
18
+
19
+ **Copyright** is held by the original contributor according to the versioning history; see LICENSE.
3rdparty/caffe/INSTALL.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Installation
2
+
3
+ See http://caffe.berkeleyvision.org/installation.html for the latest
4
+ installation instructions.
5
+
6
+ Check the users group in case you need help:
7
+ https://groups.google.com/forum/#!forum/caffe-users
3rdparty/caffe/LICENSE ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ COPYRIGHT
2
+
3
+ All contributions by the University of California:
4
+ Copyright (c) 2014-2017 The Regents of the University of California (Regents)
5
+ All rights reserved.
6
+
7
+ All other contributions:
8
+ Copyright (c) 2014-2017, the respective contributors
9
+ All rights reserved.
10
+
11
+ Caffe uses a shared copyright model: each contributor holds copyright over
12
+ their contributions to Caffe. The project versioning records all such
13
+ contribution and copyright details. If a contributor wants to further mark
14
+ their specific copyright on a particular contribution, they should indicate
15
+ their copyright solely in the commit message of the change when it is
16
+ committed.
17
+
18
+ LICENSE
19
+
20
+ Redistribution and use in source and binary forms, with or without
21
+ modification, are permitted provided that the following conditions are met:
22
+
23
+ 1. Redistributions of source code must retain the above copyright notice, this
24
+ list of conditions and the following disclaimer.
25
+ 2. Redistributions in binary form must reproduce the above copyright notice,
26
+ this list of conditions and the following disclaimer in the documentation
27
+ and/or other materials provided with the distribution.
28
+
29
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
33
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
+
40
+ CONTRIBUTION AGREEMENT
41
+
42
+ By contributing to the BVLC/caffe repository through pull-request, comment,
43
+ or otherwise, the contributor releases their content to the
44
+ license and copyright terms herein.
3rdparty/caffe/Makefile ADDED
@@ -0,0 +1,714 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PROJECT := caffe
2
+
3
+ CONFIG_FILE := Makefile.config
4
+ # Explicitly check for the config file, otherwise make -k will proceed anyway.
5
+ ifeq ($(wildcard $(CONFIG_FILE)),)
6
+ $(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example.)
7
+ endif
8
+ include $(CONFIG_FILE)
9
+
10
+ BUILD_DIR_LINK := $(BUILD_DIR)
11
+ ifeq ($(RELEASE_BUILD_DIR),)
12
+ RELEASE_BUILD_DIR := .$(BUILD_DIR)_release
13
+ endif
14
+ ifeq ($(DEBUG_BUILD_DIR),)
15
+ DEBUG_BUILD_DIR := .$(BUILD_DIR)_debug
16
+ endif
17
+
18
+ DEBUG ?= 0
19
+ ifeq ($(DEBUG), 1)
20
+ BUILD_DIR := $(DEBUG_BUILD_DIR)
21
+ OTHER_BUILD_DIR := $(RELEASE_BUILD_DIR)
22
+ else
23
+ BUILD_DIR := $(RELEASE_BUILD_DIR)
24
+ OTHER_BUILD_DIR := $(DEBUG_BUILD_DIR)
25
+ endif
26
+
27
+ # All of the directories containing code.
28
+ SRC_DIRS := $(shell find * -type d -exec bash -c "find {} -maxdepth 1 \
29
+ \( -name '*.cpp' -o -name '*.proto' \) | grep -q ." \; -print)
30
+
31
+ # The target shared library name
32
+ LIBRARY_NAME := $(PROJECT)
33
+ LIB_BUILD_DIR := $(BUILD_DIR)/lib
34
+ STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
35
+ DYNAMIC_VERSION_MAJOR := 1
36
+ DYNAMIC_VERSION_MINOR := 0
37
+ DYNAMIC_VERSION_REVISION := 0
38
+ DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
39
+ #DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
40
+ DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
41
+ DYNAMIC_NAME := $(LIB_BUILD_DIR)/$(DYNAMIC_VERSIONED_NAME_SHORT)
42
+ COMMON_FLAGS += -DCAFFE_VERSION=$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
43
+ # OpenPose: added C++11 flag to avoid crashing in some old GCC compilers
44
+ COMMON_FLAGS += -std=c++11
45
+ # OpenPose: end modified
46
+
47
+ ##############################
48
+ # Get all source files
49
+ ##############################
50
+ # CXX_SRCS are the source files excluding the test ones.
51
+ CXX_SRCS := $(shell find src/$(PROJECT) ! -name "test_*.cpp" -name "*.cpp")
52
+ # CU_SRCS are the cuda source files
53
+ CU_SRCS := $(shell find src/$(PROJECT) ! -name "test_*.cu" -name "*.cu")
54
+ # TEST_SRCS are the test source files
55
+ TEST_MAIN_SRC := src/$(PROJECT)/test/test_caffe_main.cpp
56
+ TEST_SRCS := $(shell find src/$(PROJECT) -name "test_*.cpp")
57
+ TEST_SRCS := $(filter-out $(TEST_MAIN_SRC), $(TEST_SRCS))
58
+ TEST_CU_SRCS := $(shell find src/$(PROJECT) -name "test_*.cu")
59
+ GTEST_SRC := src/gtest/gtest-all.cpp
60
+ # TOOL_SRCS are the source files for the tool binaries
61
+ TOOL_SRCS := $(shell find tools -name "*.cpp")
62
+ # EXAMPLE_SRCS are the source files for the example binaries
63
+ EXAMPLE_SRCS := $(shell find examples -name "*.cpp")
64
+ # BUILD_INCLUDE_DIR contains any generated header files we want to include.
65
+ BUILD_INCLUDE_DIR := $(BUILD_DIR)/src
66
+ # PROTO_SRCS are the protocol buffer definitions
67
+ PROTO_SRC_DIR := src/$(PROJECT)/proto
68
+ PROTO_SRCS := $(wildcard $(PROTO_SRC_DIR)/*.proto)
69
+ # PROTO_BUILD_DIR will contain the .cc and obj files generated from
70
+ # PROTO_SRCS; PROTO_BUILD_INCLUDE_DIR will contain the .h header files
71
+ PROTO_BUILD_DIR := $(BUILD_DIR)/$(PROTO_SRC_DIR)
72
+ PROTO_BUILD_INCLUDE_DIR := $(BUILD_INCLUDE_DIR)/$(PROJECT)/proto
73
+ # NONGEN_CXX_SRCS includes all source/header files except those generated
74
+ # automatically (e.g., by proto).
75
+ NONGEN_CXX_SRCS := $(shell find \
76
+ src/$(PROJECT) \
77
+ include/$(PROJECT) \
78
+ python/$(PROJECT) \
79
+ matlab/+$(PROJECT)/private \
80
+ examples \
81
+ tools \
82
+ -name "*.cpp" -or -name "*.hpp" -or -name "*.cu" -or -name "*.cuh")
83
+ LINT_SCRIPT := scripts/cpp_lint.py
84
+ LINT_OUTPUT_DIR := $(BUILD_DIR)/.lint
85
+ LINT_EXT := lint.txt
86
+ LINT_OUTPUTS := $(addsuffix .$(LINT_EXT), $(addprefix $(LINT_OUTPUT_DIR)/, $(NONGEN_CXX_SRCS)))
87
+ EMPTY_LINT_REPORT := $(BUILD_DIR)/.$(LINT_EXT)
88
+ NONEMPTY_LINT_REPORT := $(BUILD_DIR)/$(LINT_EXT)
89
+ # PY$(PROJECT)_SRC is the python wrapper for $(PROJECT)
90
+ PY$(PROJECT)_SRC := python/$(PROJECT)/_$(PROJECT).cpp
91
+ PY$(PROJECT)_SO := python/$(PROJECT)/_$(PROJECT).so
92
+ PY$(PROJECT)_HXX := include/$(PROJECT)/layers/python_layer.hpp
93
+ # MAT$(PROJECT)_SRC is the mex entrance point of matlab package for $(PROJECT)
94
+ MAT$(PROJECT)_SRC := matlab/+$(PROJECT)/private/$(PROJECT)_.cpp
95
+ ifneq ($(MATLAB_DIR),)
96
+ MAT_SO_EXT := $(shell $(MATLAB_DIR)/bin/mexext)
97
+ endif
98
+ MAT$(PROJECT)_SO := matlab/+$(PROJECT)/private/$(PROJECT)_.$(MAT_SO_EXT)
99
+
100
+ ##############################
101
+ # Derive generated files
102
+ ##############################
103
+ # The generated files for protocol buffers
104
+ PROTO_GEN_HEADER_SRCS := $(addprefix $(PROTO_BUILD_DIR)/, \
105
+ $(notdir ${PROTO_SRCS:.proto=.pb.h}))
106
+ PROTO_GEN_HEADER := $(addprefix $(PROTO_BUILD_INCLUDE_DIR)/, \
107
+ $(notdir ${PROTO_SRCS:.proto=.pb.h}))
108
+ PROTO_GEN_CC := $(addprefix $(BUILD_DIR)/, ${PROTO_SRCS:.proto=.pb.cc})
109
+ PY_PROTO_BUILD_DIR := python/$(PROJECT)/proto
110
+ PY_PROTO_INIT := python/$(PROJECT)/proto/__init__.py
111
+ PROTO_GEN_PY := $(foreach file,${PROTO_SRCS:.proto=_pb2.py}, \
112
+ $(PY_PROTO_BUILD_DIR)/$(notdir $(file)))
113
+ # The objects corresponding to the source files
114
+ # These objects will be linked into the final shared library, so we
115
+ # exclude the tool, example, and test objects.
116
+ CXX_OBJS := $(addprefix $(BUILD_DIR)/, ${CXX_SRCS:.cpp=.o})
117
+ CU_OBJS := $(addprefix $(BUILD_DIR)/cuda/, ${CU_SRCS:.cu=.o})
118
+ PROTO_OBJS := ${PROTO_GEN_CC:.cc=.o}
119
+ OBJS := $(PROTO_OBJS) $(CXX_OBJS) $(CU_OBJS)
120
+ # tool, example, and test objects
121
+ TOOL_OBJS := $(addprefix $(BUILD_DIR)/, ${TOOL_SRCS:.cpp=.o})
122
+ TOOL_BUILD_DIR := $(BUILD_DIR)/tools
123
+ TEST_CXX_BUILD_DIR := $(BUILD_DIR)/src/$(PROJECT)/test
124
+ TEST_CU_BUILD_DIR := $(BUILD_DIR)/cuda/src/$(PROJECT)/test
125
+ TEST_CXX_OBJS := $(addprefix $(BUILD_DIR)/, ${TEST_SRCS:.cpp=.o})
126
+ TEST_CU_OBJS := $(addprefix $(BUILD_DIR)/cuda/, ${TEST_CU_SRCS:.cu=.o})
127
+ TEST_OBJS := $(TEST_CXX_OBJS) $(TEST_CU_OBJS)
128
+ GTEST_OBJ := $(addprefix $(BUILD_DIR)/, ${GTEST_SRC:.cpp=.o})
129
+ EXAMPLE_OBJS := $(addprefix $(BUILD_DIR)/, ${EXAMPLE_SRCS:.cpp=.o})
130
+ # Output files for automatic dependency generation
131
+ DEPS := ${CXX_OBJS:.o=.d} ${CU_OBJS:.o=.d} ${TEST_CXX_OBJS:.o=.d} \
132
+ ${TEST_CU_OBJS:.o=.d} $(BUILD_DIR)/${MAT$(PROJECT)_SO:.$(MAT_SO_EXT)=.d}
133
+ # tool, example, and test bins
134
+ TOOL_BINS := ${TOOL_OBJS:.o=.bin}
135
+ EXAMPLE_BINS := ${EXAMPLE_OBJS:.o=.bin}
136
+ # symlinks to tool bins without the ".bin" extension
137
+ TOOL_BIN_LINKS := ${TOOL_BINS:.bin=}
138
+ # Put the test binaries in build/test for convenience.
139
+ TEST_BIN_DIR := $(BUILD_DIR)/test
140
+ TEST_CU_BINS := $(addsuffix .testbin,$(addprefix $(TEST_BIN_DIR)/, \
141
+ $(foreach obj,$(TEST_CU_OBJS),$(basename $(notdir $(obj))))))
142
+ TEST_CXX_BINS := $(addsuffix .testbin,$(addprefix $(TEST_BIN_DIR)/, \
143
+ $(foreach obj,$(TEST_CXX_OBJS),$(basename $(notdir $(obj))))))
144
+ TEST_BINS := $(TEST_CXX_BINS) $(TEST_CU_BINS)
145
+ # TEST_ALL_BIN is the test binary that links caffe dynamically.
146
+ TEST_ALL_BIN := $(TEST_BIN_DIR)/test_all.testbin
147
+
148
+ ##############################
149
+ # Derive compiler warning dump locations
150
+ ##############################
151
+ WARNS_EXT := warnings.txt
152
+ CXX_WARNS := $(addprefix $(BUILD_DIR)/, ${CXX_SRCS:.cpp=.o.$(WARNS_EXT)})
153
+ CU_WARNS := $(addprefix $(BUILD_DIR)/cuda/, ${CU_SRCS:.cu=.o.$(WARNS_EXT)})
154
+ TOOL_WARNS := $(addprefix $(BUILD_DIR)/, ${TOOL_SRCS:.cpp=.o.$(WARNS_EXT)})
155
+ EXAMPLE_WARNS := $(addprefix $(BUILD_DIR)/, ${EXAMPLE_SRCS:.cpp=.o.$(WARNS_EXT)})
156
+ TEST_WARNS := $(addprefix $(BUILD_DIR)/, ${TEST_SRCS:.cpp=.o.$(WARNS_EXT)})
157
+ TEST_CU_WARNS := $(addprefix $(BUILD_DIR)/cuda/, ${TEST_CU_SRCS:.cu=.o.$(WARNS_EXT)})
158
+ ALL_CXX_WARNS := $(CXX_WARNS) $(TOOL_WARNS) $(EXAMPLE_WARNS) $(TEST_WARNS)
159
+ ALL_CU_WARNS := $(CU_WARNS) $(TEST_CU_WARNS)
160
+ ALL_WARNS := $(ALL_CXX_WARNS) $(ALL_CU_WARNS)
161
+
162
+ EMPTY_WARN_REPORT := $(BUILD_DIR)/.$(WARNS_EXT)
163
+ NONEMPTY_WARN_REPORT := $(BUILD_DIR)/$(WARNS_EXT)
164
+
165
+ ##############################
166
+ # Derive include and lib directories
167
+ ##############################
168
+ CUDA_INCLUDE_DIR := $(CUDA_DIR)/include
169
+
170
+ CUDA_LIB_DIR :=
171
+ # add <cuda>/lib64 only if it exists
172
+ ifneq ("$(wildcard $(CUDA_DIR)/lib64)","")
173
+ CUDA_LIB_DIR += $(CUDA_DIR)/lib64
174
+ endif
175
+ CUDA_LIB_DIR += $(CUDA_DIR)/lib
176
+
177
+ INCLUDE_DIRS += $(BUILD_INCLUDE_DIR) ./src ./include
178
+ ifneq ($(CPU_ONLY), 1)
179
+ INCLUDE_DIRS += $(CUDA_INCLUDE_DIR)
180
+ LIBRARY_DIRS += $(CUDA_LIB_DIR)
181
+ LIBRARIES := cudart cublas curand
182
+ endif
183
+
184
+ LIBRARIES += glog gflags protobuf boost_system boost_filesystem m
185
+
186
+ # handle IO dependencies
187
+ USE_LEVELDB ?= 1
188
+ USE_LMDB ?= 1
189
+ # This code is taken from https://github.com/sh1r0/caffe-android-lib
190
+ USE_HDF5 ?= 1
191
+ USE_OPENCV ?= 1
192
+
193
+ ifeq ($(USE_LEVELDB), 1)
194
+ LIBRARIES += leveldb snappy
195
+ endif
196
+ ifeq ($(USE_LMDB), 1)
197
+ LIBRARIES += lmdb
198
+ endif
199
+ # This code is taken from https://github.com/sh1r0/caffe-android-lib
200
+ ifeq ($(USE_HDF5), 1)
201
+ LIBRARIES += hdf5_hl hdf5
202
+ endif
203
+ ifeq ($(USE_OPENCV), 1)
204
+ LIBRARIES += opencv_core opencv_highgui opencv_imgproc
205
+
206
+ ifeq ($(OPENCV_VERSION), 3)
207
+ LIBRARIES += opencv_imgcodecs
208
+ endif
209
+
210
+ endif
211
+ PYTHON_LIBRARIES ?= boost_python python2.7
212
+ WARNINGS := -Wall -Wno-sign-compare
213
+
214
+ ##############################
215
+ # Set build directories
216
+ ##############################
217
+
218
+ DISTRIBUTE_DIR ?= distribute
219
+ DISTRIBUTE_SUBDIRS := $(DISTRIBUTE_DIR)/bin $(DISTRIBUTE_DIR)/lib
220
+ DIST_ALIASES := dist
221
+ ifneq ($(strip $(DISTRIBUTE_DIR)),distribute)
222
+ DIST_ALIASES += distribute
223
+ endif
224
+
225
+ ALL_BUILD_DIRS := $(sort $(BUILD_DIR) $(addprefix $(BUILD_DIR)/, $(SRC_DIRS)) \
226
+ $(addprefix $(BUILD_DIR)/cuda/, $(SRC_DIRS)) \
227
+ $(LIB_BUILD_DIR) $(TEST_BIN_DIR) $(PY_PROTO_BUILD_DIR) $(LINT_OUTPUT_DIR) \
228
+ $(DISTRIBUTE_SUBDIRS) $(PROTO_BUILD_INCLUDE_DIR))
229
+
230
+ ##############################
231
+ # Set directory for Doxygen-generated documentation
232
+ ##############################
233
+ DOXYGEN_CONFIG_FILE ?= ./.Doxyfile
234
+ # should be the same as OUTPUT_DIRECTORY in the .Doxyfile
235
+ DOXYGEN_OUTPUT_DIR ?= ./doxygen
236
+ DOXYGEN_COMMAND ?= doxygen
237
+ # All the files that might have Doxygen documentation.
238
+ DOXYGEN_SOURCES := $(shell find \
239
+ src/$(PROJECT) \
240
+ include/$(PROJECT) \
241
+ python/ \
242
+ matlab/ \
243
+ examples \
244
+ tools \
245
+ -name "*.cpp" -or -name "*.hpp" -or -name "*.cu" -or -name "*.cuh" -or \
246
+ -name "*.py" -or -name "*.m")
247
+ DOXYGEN_SOURCES += $(DOXYGEN_CONFIG_FILE)
248
+
249
+
250
+ ##############################
251
+ # Configure build
252
+ ##############################
253
+
254
+ # Determine platform
255
+ UNAME := $(shell uname -s)
256
+ ifeq ($(UNAME), Linux)
257
+ LINUX := 1
258
+ else ifeq ($(UNAME), Darwin)
259
+ OSX := 1
260
+ OSX_MAJOR_VERSION := $(shell sw_vers -productVersion | cut -f 1 -d .)
261
+ OSX_MINOR_VERSION := $(shell sw_vers -productVersion | cut -f 2 -d .)
262
+ endif
263
+
264
+ # Linux
265
+ ifeq ($(LINUX), 1)
266
+ CXX ?= /usr/bin/g++
267
+ GCCVERSION := $(shell $(CXX) -dumpversion | cut -f1,2 -d.)
268
+ # older versions of gcc are too dumb to build boost with -Wuninitalized
269
+ ifeq ($(shell echo | awk '{exit $(GCCVERSION) < 4.6;}'), 1)
270
+ WARNINGS += -Wno-uninitialized
271
+ endif
272
+ # boost::thread is reasonably called boost_thread (compare OS X)
273
+ # We will also explicitly add stdc++ to the link target.
274
+ LIBRARIES += boost_thread stdc++
275
+ VERSIONFLAGS += -Wl,-soname,$(DYNAMIC_VERSIONED_NAME_SHORT) -Wl,-rpath,$(ORIGIN)/../lib
276
+ endif
277
+
278
+ # OS X:
279
+ # clang++ instead of g++
280
+ # libstdc++ for NVCC compatibility on OS X >= 10.9 with CUDA < 7.0
281
+ ifeq ($(OSX), 1)
282
+ CXX := /usr/bin/clang++
283
+ ifneq ($(CPU_ONLY), 1)
284
+ CUDA_VERSION := $(shell $(CUDA_DIR)/bin/nvcc -V | grep -o 'release [0-9.]*' | tr -d '[a-z ]')
285
+ ifeq ($(shell echo | awk '{exit $(CUDA_VERSION) < 7.0;}'), 1)
286
+ CXXFLAGS += -stdlib=libstdc++
287
+ LINKFLAGS += -stdlib=libstdc++
288
+ endif
289
+ # clang throws this warning for cuda headers
290
+ WARNINGS += -Wno-unneeded-internal-declaration
291
+ # 10.11 strips DYLD_* env vars so link CUDA (rpath is available on 10.5+)
292
+ OSX_10_OR_LATER := $(shell [ $(OSX_MAJOR_VERSION) -ge 10 ] && echo true)
293
+ OSX_10_5_OR_LATER := $(shell [ $(OSX_MINOR_VERSION) -ge 5 ] && echo true)
294
+ ifeq ($(OSX_10_OR_LATER),true)
295
+ ifeq ($(OSX_10_5_OR_LATER),true)
296
+ LDFLAGS += -Wl,-rpath,$(CUDA_LIB_DIR)
297
+ endif
298
+ endif
299
+ endif
300
+ # gtest needs to use its own tuple to not conflict with clang
301
+ COMMON_FLAGS += -DGTEST_USE_OWN_TR1_TUPLE=1
302
+ # boost::thread is called boost_thread-mt to mark multithreading on OS X
303
+ LIBRARIES += boost_thread-mt
304
+ # we need to explicitly ask for the rpath to be obeyed
305
+ ORIGIN := @loader_path
306
+ VERSIONFLAGS += -Wl,-install_name,@rpath/$(DYNAMIC_VERSIONED_NAME_SHORT) -Wl,-rpath,$(ORIGIN)/../../build/lib
307
+ else
308
+ ORIGIN := \$$ORIGIN
309
+ endif
310
+
311
+ # Custom compiler
312
+ ifdef CUSTOM_CXX
313
+ CXX := $(CUSTOM_CXX)
314
+ endif
315
+
316
+ # Static linking
317
+ ifneq (,$(findstring clang++,$(CXX)))
318
+ STATIC_LINK_COMMAND := -Wl,-force_load $(STATIC_NAME)
319
+ else ifneq (,$(findstring g++,$(CXX)))
320
+ STATIC_LINK_COMMAND := -Wl,--whole-archive $(STATIC_NAME) -Wl,--no-whole-archive
321
+ else
322
+ # The following line must not be indented with a tab, since we are not inside a target
323
+ $(error Cannot static link with the $(CXX) compiler)
324
+ endif
325
+
326
+ # Debugging
327
+ ifeq ($(DEBUG), 1)
328
+ COMMON_FLAGS += -DDEBUG -g -O0
329
+ NVCCFLAGS += -G
330
+ else
331
+ # OpenPose: modified `-O2` by `-O3`
332
+ COMMON_FLAGS += -DNDEBUG -O3
333
+ # OpenPose: end modified
334
+ endif
335
+
336
+ # cuDNN acceleration configuration.
337
+ ifeq ($(USE_CUDNN), 1)
338
+ LIBRARIES += cudnn
339
+ COMMON_FLAGS += -DUSE_CUDNN
340
+ endif
341
+
342
+ # NCCL acceleration configuration
343
+ ifeq ($(USE_NCCL), 1)
344
+ LIBRARIES += nccl
345
+ COMMON_FLAGS += -DUSE_NCCL
346
+ endif
347
+
348
+ # configure IO libraries
349
+ ifeq ($(USE_OPENCV), 1)
350
+ COMMON_FLAGS += -DUSE_OPENCV
351
+ endif
352
+ ifeq ($(USE_LEVELDB), 1)
353
+ COMMON_FLAGS += -DUSE_LEVELDB
354
+ endif
355
+ ifeq ($(USE_LMDB), 1)
356
+ COMMON_FLAGS += -DUSE_LMDB
357
+ ifeq ($(ALLOW_LMDB_NOLOCK), 1)
358
+ COMMON_FLAGS += -DALLOW_LMDB_NOLOCK
359
+ endif
360
+ endif
361
+ # This code is taken from https://github.com/sh1r0/caffe-android-lib
362
+ ifeq ($(USE_HDF5), 1)
363
+ COMMON_FLAGS += -DUSE_HDF5
364
+ endif
365
+
366
+ # CPU-only configuration
367
+ ifeq ($(CPU_ONLY), 1)
368
+ OBJS := $(PROTO_OBJS) $(CXX_OBJS)
369
+ TEST_OBJS := $(TEST_CXX_OBJS)
370
+ TEST_BINS := $(TEST_CXX_BINS)
371
+ ALL_WARNS := $(ALL_CXX_WARNS)
372
+ TEST_FILTER := --gtest_filter="-*GPU*"
373
+ COMMON_FLAGS += -DCPU_ONLY
374
+ endif
375
+
376
+ # Python layer support
377
+ ifeq ($(WITH_PYTHON_LAYER), 1)
378
+ COMMON_FLAGS += -DWITH_PYTHON_LAYER
379
+ LIBRARIES += $(PYTHON_LIBRARIES)
380
+ endif
381
+
382
+ # BLAS configuration (default = ATLAS)
383
+ BLAS ?= atlas
384
+ ifeq ($(BLAS), mkl)
385
+ # MKL
386
+ LIBRARIES += mkl_rt
387
+ COMMON_FLAGS += -DUSE_MKL
388
+ MKLROOT ?= /opt/intel/mkl
389
+ BLAS_INCLUDE ?= $(MKLROOT)/include
390
+ BLAS_LIB ?= $(MKLROOT)/lib $(MKLROOT)/lib/intel64
391
+ else ifeq ($(BLAS), open)
392
+ # OpenBLAS
393
+ LIBRARIES += openblas
394
+ else
395
+ # ATLAS
396
+ ifeq ($(LINUX), 1)
397
+ ifeq ($(BLAS), atlas)
398
+ # Linux simply has cblas and atlas
399
+ LIBRARIES += cblas atlas
400
+ endif
401
+ else ifeq ($(OSX), 1)
402
+ # OS X packages atlas as the vecLib framework
403
+ LIBRARIES += cblas
404
+ # 10.10 has accelerate while 10.9 has veclib
405
+ XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep 'version' | sed 's/[^0-9]*\([0-9]\).*/\1/')
406
+ XCODE_CLT_GEQ_7 := $(shell [ $(XCODE_CLT_VER) -gt 6 ] && echo 1)
407
+ XCODE_CLT_GEQ_6 := $(shell [ $(XCODE_CLT_VER) -gt 5 ] && echo 1)
408
+ ifeq ($(XCODE_CLT_GEQ_7), 1)
409
+ BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(shell ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ | sort | tail -1)/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers
410
+ else ifeq ($(XCODE_CLT_GEQ_6), 1)
411
+ BLAS_INCLUDE ?= /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
412
+ LDFLAGS += -framework Accelerate
413
+ else
414
+ BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
415
+ LDFLAGS += -framework vecLib
416
+ endif
417
+ endif
418
+ endif
419
+ INCLUDE_DIRS += $(BLAS_INCLUDE)
420
+ LIBRARY_DIRS += $(BLAS_LIB)
421
+
422
+ LIBRARY_DIRS += $(LIB_BUILD_DIR)
423
+
424
+ # Automatic dependency generation (nvcc is handled separately)
425
+ CXXFLAGS += -MMD -MP
426
+
427
+ # Complete build flags.
428
+ COMMON_FLAGS += $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir))
429
+ CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
430
+ NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
431
+ # mex may invoke an older gcc that is too liberal with -Wuninitalized
432
+ MATLAB_CXXFLAGS := $(CXXFLAGS) -Wno-uninitialized
433
+ LINKFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)
434
+
435
+ USE_PKG_CONFIG ?= 0
436
+ ifeq ($(USE_PKG_CONFIG), 1)
437
+ PKG_CONFIG := $(shell pkg-config opencv --libs)
438
+ else
439
+ PKG_CONFIG :=
440
+ endif
441
+ LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(PKG_CONFIG) \
442
+ $(foreach library,$(LIBRARIES),-l$(library))
443
+ PYTHON_LDFLAGS := $(LDFLAGS) $(foreach library,$(PYTHON_LIBRARIES),-l$(library))
444
+
445
+ # 'superclean' target recursively* deletes all files ending with an extension
446
+ # in $(SUPERCLEAN_EXTS) below. This may be useful if you've built older
447
+ # versions of Caffe that do not place all generated files in a location known
448
+ # to the 'clean' target.
449
+ #
450
+ # 'supercleanlist' will list the files to be deleted by make superclean.
451
+ #
452
+ # * Recursive with the exception that symbolic links are never followed, per the
453
+ # default behavior of 'find'.
454
+ SUPERCLEAN_EXTS := .so .a .o .bin .testbin .pb.cc .pb.h _pb2.py .cuo
455
+
456
+ # Set the sub-targets of the 'everything' target.
457
+ EVERYTHING_TARGETS := all py$(PROJECT) test warn lint
458
+ # Only build matcaffe as part of "everything" if MATLAB_DIR is specified.
459
+ ifneq ($(MATLAB_DIR),)
460
+ EVERYTHING_TARGETS += mat$(PROJECT)
461
+ endif
462
+
463
+ ##############################
464
+ # Define build targets
465
+ ##############################
466
+ .PHONY: all lib test clean docs linecount lint lintclean tools examples $(DIST_ALIASES) \
467
+ py mat py$(PROJECT) mat$(PROJECT) proto runtest \
468
+ superclean supercleanlist supercleanfiles warn everything
469
+
470
+ all: lib tools examples
471
+
472
+ lib: $(STATIC_NAME) $(DYNAMIC_NAME)
473
+
474
+ everything: $(EVERYTHING_TARGETS)
475
+
476
+ linecount:
477
+ cloc --read-lang-def=$(PROJECT).cloc \
478
+ src/$(PROJECT) include/$(PROJECT) tools examples \
479
+ python matlab
480
+
481
+ lint: $(EMPTY_LINT_REPORT)
482
+
483
+ lintclean:
484
+ @ $(RM) -r $(LINT_OUTPUT_DIR) $(EMPTY_LINT_REPORT) $(NONEMPTY_LINT_REPORT)
485
+
486
+ docs: $(DOXYGEN_OUTPUT_DIR)
487
+ @ cd ./docs ; ln -sfn ../$(DOXYGEN_OUTPUT_DIR)/html doxygen
488
+
489
+ $(DOXYGEN_OUTPUT_DIR): $(DOXYGEN_CONFIG_FILE) $(DOXYGEN_SOURCES)
490
+ $(DOXYGEN_COMMAND) $(DOXYGEN_CONFIG_FILE)
491
+
492
+ $(EMPTY_LINT_REPORT): $(LINT_OUTPUTS) | $(BUILD_DIR)
493
+ @ cat $(LINT_OUTPUTS) > $@
494
+ @ if [ -s "$@" ]; then \
495
+ cat $@; \
496
+ mv $@ $(NONEMPTY_LINT_REPORT); \
497
+ echo "Found one or more lint errors."; \
498
+ exit 1; \
499
+ fi; \
500
+ $(RM) $(NONEMPTY_LINT_REPORT); \
501
+ echo "No lint errors!";
502
+
503
+ $(LINT_OUTPUTS): $(LINT_OUTPUT_DIR)/%.lint.txt : % $(LINT_SCRIPT) | $(LINT_OUTPUT_DIR)
504
+ @ mkdir -p $(dir $@)
505
+ @ python $(LINT_SCRIPT) $< 2>&1 \
506
+ | grep -v "^Done processing " \
507
+ | grep -v "^Total errors found: 0" \
508
+ > $@ \
509
+ || true
510
+
511
+ test: $(TEST_ALL_BIN) $(TEST_ALL_DYNLINK_BIN) $(TEST_BINS)
512
+
513
+ tools: $(TOOL_BINS) $(TOOL_BIN_LINKS)
514
+
515
+ examples: $(EXAMPLE_BINS)
516
+
517
+ py$(PROJECT): py
518
+
519
+ py: $(PY$(PROJECT)_SO) $(PROTO_GEN_PY)
520
+
521
+ $(PY$(PROJECT)_SO): $(PY$(PROJECT)_SRC) $(PY$(PROJECT)_HXX) | $(DYNAMIC_NAME)
522
+ @ echo CXX/LD -o $@ $<
523
+ $(Q)$(CXX) -shared -o $@ $(PY$(PROJECT)_SRC) \
524
+ -o $@ $(LINKFLAGS) -l$(LIBRARY_NAME) $(PYTHON_LDFLAGS) \
525
+ -Wl,-rpath,$(ORIGIN)/../../build/lib
526
+
527
+ mat$(PROJECT): mat
528
+
529
+ mat: $(MAT$(PROJECT)_SO)
530
+
531
+ $(MAT$(PROJECT)_SO): $(MAT$(PROJECT)_SRC) $(STATIC_NAME)
532
+ @ if [ -z "$(MATLAB_DIR)" ]; then \
533
+ echo "MATLAB_DIR must be specified in $(CONFIG_FILE)" \
534
+ "to build mat$(PROJECT)."; \
535
+ exit 1; \
536
+ fi
537
+ @ echo MEX $<
538
+ $(Q)$(MATLAB_DIR)/bin/mex $(MAT$(PROJECT)_SRC) \
539
+ CXX="$(CXX)" \
540
+ CXXFLAGS="\$$CXXFLAGS $(MATLAB_CXXFLAGS)" \
541
+ CXXLIBS="\$$CXXLIBS $(STATIC_LINK_COMMAND) $(LDFLAGS)" -output $@
542
+ @ if [ -f "$(PROJECT)_.d" ]; then \
543
+ mv -f $(PROJECT)_.d $(BUILD_DIR)/${MAT$(PROJECT)_SO:.$(MAT_SO_EXT)=.d}; \
544
+ fi
545
+
546
+ runtest: $(TEST_ALL_BIN)
547
+ $(TOOL_BUILD_DIR)/caffe
548
+ $(TEST_ALL_BIN) $(TEST_GPUID) --gtest_shuffle $(TEST_FILTER)
549
+
550
+ pytest: py
551
+ cd python; python -m unittest discover -s caffe/test
552
+
553
+ mattest: mat
554
+ cd matlab; $(MATLAB_DIR)/bin/matlab -nodisplay -r 'caffe.run_tests(), exit()'
555
+
556
+ warn: $(EMPTY_WARN_REPORT)
557
+
558
+ $(EMPTY_WARN_REPORT): $(ALL_WARNS) | $(BUILD_DIR)
559
+ @ cat $(ALL_WARNS) > $@
560
+ @ if [ -s "$@" ]; then \
561
+ cat $@; \
562
+ mv $@ $(NONEMPTY_WARN_REPORT); \
563
+ echo "Compiler produced one or more warnings."; \
564
+ exit 1; \
565
+ fi; \
566
+ $(RM) $(NONEMPTY_WARN_REPORT); \
567
+ echo "No compiler warnings!";
568
+
569
+ $(ALL_WARNS): %.o.$(WARNS_EXT) : %.o
570
+
571
+ $(BUILD_DIR_LINK): $(BUILD_DIR)/.linked
572
+
573
+ # Create a target ".linked" in this BUILD_DIR to tell Make that the "build" link
574
+ # is currently correct, then delete the one in the OTHER_BUILD_DIR in case it
575
+ # exists and $(DEBUG) is toggled later.
576
+ $(BUILD_DIR)/.linked:
577
+ @ mkdir -p $(BUILD_DIR)
578
+ @ $(RM) $(OTHER_BUILD_DIR)/.linked
579
+ @ $(RM) -r $(BUILD_DIR_LINK)
580
+ @ ln -s $(BUILD_DIR) $(BUILD_DIR_LINK)
581
+ @ touch $@
582
+
583
+ $(ALL_BUILD_DIRS): | $(BUILD_DIR_LINK)
584
+ @ mkdir -p $@
585
+
586
+ $(DYNAMIC_NAME): $(OBJS) | $(LIB_BUILD_DIR)
587
+ @ echo LD -o $@
588
+ $(Q)$(CXX) -shared -o $@ $(OBJS) $(VERSIONFLAGS) $(LINKFLAGS) $(LDFLAGS)
589
+ @ cd $(BUILD_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT)
590
+
591
+ $(STATIC_NAME): $(OBJS) | $(LIB_BUILD_DIR)
592
+ @ echo AR -o $@
593
+ $(Q)ar rcs $@ $(OBJS)
594
+
595
+ $(BUILD_DIR)/%.o: %.cpp $(PROTO_GEN_HEADER) | $(ALL_BUILD_DIRS)
596
+ @ echo CXX $<
597
+ $(Q)$(CXX) $< $(CXXFLAGS) -c -o $@ 2> $@.$(WARNS_EXT) \
598
+ || (cat $@.$(WARNS_EXT); exit 1)
599
+ @ cat $@.$(WARNS_EXT)
600
+
601
+ $(PROTO_BUILD_DIR)/%.pb.o: $(PROTO_BUILD_DIR)/%.pb.cc $(PROTO_GEN_HEADER) \
602
+ | $(PROTO_BUILD_DIR)
603
+ @ echo CXX $<
604
+ $(Q)$(CXX) $< $(CXXFLAGS) -c -o $@ 2> $@.$(WARNS_EXT) \
605
+ || (cat $@.$(WARNS_EXT); exit 1)
606
+ @ cat $@.$(WARNS_EXT)
607
+
608
+ $(BUILD_DIR)/cuda/%.o: %.cu | $(ALL_BUILD_DIRS)
609
+ @ echo NVCC $<
610
+ $(Q)$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -M $< -o ${@:.o=.d} \
611
+ -odir $(@D)
612
+ $(Q)$(CUDA_DIR)/bin/nvcc $(NVCCFLAGS) $(CUDA_ARCH) -c $< -o $@ 2> $@.$(WARNS_EXT) \
613
+ || (cat $@.$(WARNS_EXT); exit 1)
614
+ @ cat $@.$(WARNS_EXT)
615
+
616
+ $(TEST_ALL_BIN): $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJ) \
617
+ | $(DYNAMIC_NAME) $(TEST_BIN_DIR)
618
+ @ echo CXX/LD -o $@ $<
619
+ $(Q)$(CXX) $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJ) \
620
+ -o $@ $(LINKFLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
621
+
622
+ $(TEST_CU_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CU_BUILD_DIR)/%.o \
623
+ $(GTEST_OBJ) | $(DYNAMIC_NAME) $(TEST_BIN_DIR)
624
+ @ echo LD $<
625
+ $(Q)$(CXX) $(TEST_MAIN_SRC) $< $(GTEST_OBJ) \
626
+ -o $@ $(LINKFLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
627
+
628
+ $(TEST_CXX_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CXX_BUILD_DIR)/%.o \
629
+ $(GTEST_OBJ) | $(DYNAMIC_NAME) $(TEST_BIN_DIR)
630
+ @ echo LD $<
631
+ $(Q)$(CXX) $(TEST_MAIN_SRC) $< $(GTEST_OBJ) \
632
+ -o $@ $(LINKFLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib
633
+
634
+ # Target for extension-less symlinks to tool binaries with extension '*.bin'.
635
+ $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
636
+ @ $(RM) $@
637
+ @ ln -s $(notdir $<) $@
638
+
639
+ $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME)
640
+ @ echo CXX/LD -o $@
641
+ $(Q)$(CXX) $< -o $@ $(LINKFLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
642
+ -Wl,-rpath,$(ORIGIN)/../lib
643
+
644
+ $(EXAMPLE_BINS): %.bin : %.o | $(DYNAMIC_NAME)
645
+ @ echo CXX/LD -o $@
646
+ $(Q)$(CXX) $< -o $@ $(LINKFLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \
647
+ -Wl,-rpath,$(ORIGIN)/../../lib
648
+
649
+ proto: $(PROTO_GEN_CC) $(PROTO_GEN_HEADER)
650
+
651
+ $(PROTO_BUILD_DIR)/%.pb.cc $(PROTO_BUILD_DIR)/%.pb.h : \
652
+ $(PROTO_SRC_DIR)/%.proto | $(PROTO_BUILD_DIR)
653
+ @ echo PROTOC $<
654
+ $(Q)protoc --proto_path=$(PROTO_SRC_DIR) --cpp_out=$(PROTO_BUILD_DIR) $<
655
+
656
+ $(PY_PROTO_BUILD_DIR)/%_pb2.py : $(PROTO_SRC_DIR)/%.proto \
657
+ $(PY_PROTO_INIT) | $(PY_PROTO_BUILD_DIR)
658
+ @ echo PROTOC \(python\) $<
659
+ $(Q)protoc --proto_path=src --python_out=python $<
660
+
661
+ $(PY_PROTO_INIT): | $(PY_PROTO_BUILD_DIR)
662
+ touch $(PY_PROTO_INIT)
663
+
664
+ clean:
665
+ @- $(RM) -rf $(ALL_BUILD_DIRS)
666
+ @- $(RM) -rf $(OTHER_BUILD_DIR)
667
+ @- $(RM) -rf $(BUILD_DIR_LINK)
668
+ @- $(RM) -rf $(DISTRIBUTE_DIR)
669
+ @- $(RM) $(PY$(PROJECT)_SO)
670
+ @- $(RM) $(MAT$(PROJECT)_SO)
671
+
672
+ supercleanfiles:
673
+ $(eval SUPERCLEAN_FILES := $(strip \
674
+ $(foreach ext,$(SUPERCLEAN_EXTS), $(shell find . -name '*$(ext)' \
675
+ -not -path './data/*'))))
676
+
677
+ supercleanlist: supercleanfiles
678
+ @ \
679
+ if [ -z "$(SUPERCLEAN_FILES)" ]; then \
680
+ echo "No generated files found."; \
681
+ else \
682
+ echo $(SUPERCLEAN_FILES) | tr ' ' '\n'; \
683
+ fi
684
+
685
+ superclean: clean supercleanfiles
686
+ @ \
687
+ if [ -z "$(SUPERCLEAN_FILES)" ]; then \
688
+ echo "No generated files found."; \
689
+ else \
690
+ echo "Deleting the following generated files:"; \
691
+ echo $(SUPERCLEAN_FILES) | tr ' ' '\n'; \
692
+ $(RM) $(SUPERCLEAN_FILES); \
693
+ fi
694
+
695
+ $(DIST_ALIASES): $(DISTRIBUTE_DIR)
696
+
697
+ $(DISTRIBUTE_DIR): all py | $(DISTRIBUTE_SUBDIRS)
698
+ # add proto
699
+ cp -r src/caffe/proto $(DISTRIBUTE_DIR)/
700
+ # add include
701
+ cp -r include $(DISTRIBUTE_DIR)/
702
+ mkdir -p $(DISTRIBUTE_DIR)/include/caffe/proto
703
+ cp $(PROTO_GEN_HEADER_SRCS) $(DISTRIBUTE_DIR)/include/caffe/proto
704
+ # add tool and example binaries
705
+ cp $(TOOL_BINS) $(DISTRIBUTE_DIR)/bin
706
+ cp $(EXAMPLE_BINS) $(DISTRIBUTE_DIR)/bin
707
+ # add libraries
708
+ cp $(STATIC_NAME) $(DISTRIBUTE_DIR)/lib
709
+ install -m 644 $(DYNAMIC_NAME) $(DISTRIBUTE_DIR)/lib
710
+ cd $(DISTRIBUTE_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT)
711
+ # add python - it's not the standard way, indeed...
712
+ cp -r python $(DISTRIBUTE_DIR)/
713
+
714
+ -include $(DEPS)
3rdparty/caffe/Makefile.config.Ubuntu14_cuda7.example ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Refer to http://caffe.berkeleyvision.org/installation.html
2
+ # Contributions simplifying and improving our build system are welcome!
3
+
4
+ # cuDNN acceleration switch (uncomment to build with cuDNN).
5
+ USE_CUDNN := 1
6
+
7
+ # CPU-only switch (uncomment to build without GPU support).
8
+ # CPU_ONLY := 1
9
+
10
+ # uncomment to disable IO dependencies and corresponding data layers
11
+ # USE_OPENCV := 0
12
+ # USE_LEVELDB := 0
13
+ # USE_LMDB := 0
14
+
15
+ # uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
16
+ # You should not set this flag if you will be reading LMDBs with any
17
+ # possibility of simultaneous read and write
18
+ # ALLOW_LMDB_NOLOCK := 1
19
+
20
+ # Uncomment if you're using OpenCV 3
21
+ # OPENCV_VERSION := 3
22
+
23
+ # To customize your choice of compiler, uncomment and set the following.
24
+ # N.B. the default for Linux is g++ and the default for OSX is clang++
25
+ # CUSTOM_CXX := g++
26
+
27
+ # CUDA directory contains bin/ and lib/ directories that we need.
28
+ CUDA_DIR := /usr/local/cuda
29
+ # On Ubuntu 14.04, if cuda tools are installed via
30
+ # "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
31
+ # CUDA_DIR := /usr
32
+
33
+ # CUDA architecture setting: going with all of them.
34
+ # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
35
+ # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
36
+ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
37
+ -gencode arch=compute_35,code=sm_35 \
38
+ -gencode arch=compute_50,code=sm_50 \
39
+ -gencode arch=compute_52,code=sm_52
40
+ # Deprecated
41
+ # CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
42
+ # -gencode arch=compute_20,code=sm_21 \
43
+ # -gencode arch=compute_30,code=sm_30 \
44
+ # -gencode arch=compute_35,code=sm_35 \
45
+ # -gencode arch=compute_50,code=sm_50 \
46
+ # -gencode arch=compute_52,code=sm_52 \
47
+ # -gencode arch=compute_60,code=sm_60 \
48
+ # -gencode arch=compute_61,code=sm_61 \
49
+ # -gencode arch=compute_61,code=compute_61
50
+
51
+ # BLAS choice:
52
+ # atlas for ATLAS (default)
53
+ # mkl for MKL
54
+ # open for OpenBlas
55
+ BLAS := atlas
56
+ # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
57
+ # Leave commented to accept the defaults for your choice of BLAS
58
+ # (which should work)!
59
+ # BLAS_INCLUDE := /path/to/your/blas
60
+ # BLAS_LIB := /path/to/your/blas
61
+
62
+ # Homebrew puts openblas in a directory that is not on the standard search path
63
+ # BLAS_INCLUDE := $(shell brew --prefix openblas)/include
64
+ # BLAS_LIB := $(shell brew --prefix openblas)/lib
65
+
66
+ # This is required only if you will compile the matlab interface.
67
+ # MATLAB directory should contain the mex binary in /bin.
68
+ # MATLAB_DIR := /usr/local
69
+ # MATLAB_DIR := /Applications/MATLAB_R2012b.app
70
+
71
+ # NOTE: this is required only if you will compile the python interface.
72
+ # We need to be able to find Python.h and numpy/arrayobject.h.
73
+ PYTHON_INCLUDE := /usr/include/python2.7 \
74
+ /usr/lib/python2.7/dist-packages/numpy/core/include
75
+ # Anaconda Python distribution is quite popular. Include path:
76
+ # Verify anaconda location, sometimes it's in root.
77
+ # ANACONDA_HOME := $(HOME)/anaconda
78
+ # PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
79
+ # $(ANACONDA_HOME)/include/python2.7 \
80
+ # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include
81
+
82
+ # Uncomment to use Python 3 (default is Python 2)
83
+ # PYTHON_LIBRARIES := boost_python3 python3.5m
84
+ # PYTHON_INCLUDE := /usr/include/python3.5m \
85
+ # /usr/lib/python3.5/dist-packages/numpy/core/include
86
+
87
+ # We need to be able to find libpythonX.X.so or .dylib.
88
+ PYTHON_LIB := /usr/lib /usr/local/lib
89
+ # PYTHON_LIB := $(ANACONDA_HOME)/lib
90
+
91
+ # Homebrew installs numpy in a non standard path (keg only)
92
+ # PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
93
+ # PYTHON_LIB += $(shell brew --prefix numpy)/lib
94
+
95
+ # Uncomment to support layers written in Python (will link against Python libs)
96
+ # WITH_PYTHON_LAYER := 1
97
+
98
+ # Whatever else you find you need goes here.
99
+ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
100
+ LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
101
+
102
+ # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
103
+ # INCLUDE_DIRS += $(shell brew --prefix)/include
104
+ # LIBRARY_DIRS += $(shell brew --prefix)/lib
105
+
106
+ # NCCL acceleration switch (uncomment to build with NCCL)
107
+ # https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
108
+ # USE_NCCL := 1
109
+
110
+ # Uncomment to use `pkg-config` to specify OpenCV library paths.
111
+ # (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
112
+ # USE_PKG_CONFIG := 1
113
+
114
+ # N.B. both build and distribute dirs are cleared on `make clean`
115
+ BUILD_DIR := build
116
+ DISTRIBUTE_DIR := distribute
117
+
118
+ # Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
119
+ # DEBUG := 1
120
+
121
+ # The ID of the GPU that 'make runtest' will use to run unit tests.
122
+ TEST_GPUID := 0
123
+
124
+ # enable pretty build (comment to see full commands)
125
+ Q ?= @