From 8a7d950caef192b0eaa648e88a1dea056d4bada1 Mon Sep 17 00:00:00 2001 From: gineshidalgo99 Date: Thu, 18 May 2017 14:47:54 -0400 Subject: [PATCH] Makefile: Caffe isolated + improved doc --- .github/issue_template.md | 2 +- Makefile | 11 ++++++++--- README.md | 34 +++++++++++++++++++--------------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 5c93fda1..1155cd3e 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -17,10 +17,10 @@ You might select multiple topics, delete the rest: - Other (type your own type) ### Your system configuration -**OpenCV version**: installed with `apt-get install libopencv-dev` or OpenCV 2.X or OpenCV 3.X. **Operating system** (`lsb_release -a` on Ubuntu): **CUDA version** (`cat /usr/local/cuda/version.txt` in most cases): **cuDNN version**: **GPU model** (`nvidia-smi`): **Caffe version**: Default from OpenPose or custom version. +**OpenCV version**: installed with `apt-get install libopencv-dev` or OpenCV 2.X or OpenCV 3.X. Compiler (`gcc --version` on Ubuntu): diff --git a/Makefile b/Makefile index c3f0c4e0..e6061b0e 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,8 @@ else ifeq ($(DEEP_NET), torch) # Caffe else COMMON_FLAGS += -DUSE_CAFFE + LIBRARIES += caffe + LDFLAGS += -Wl,-rpath=$(CAFFE_DIR)/lib endif ############################## @@ -138,10 +140,11 @@ INCLUDE_DIRS += $(BUILD_INCLUDE_DIR) ./src ./include ifneq ($(CPU_ONLY), 1) INCLUDE_DIRS += $(CUDA_INCLUDE_DIR) LIBRARY_DIRS += $(CUDA_LIB_DIR) - LIBRARIES := cudart cublas curand + LIBRARIES += cudart cublas curand endif -LIBRARIES += glog gflags boost_system boost_filesystem m hdf5_hl hdf5 caffe +# LIBRARIES += glog gflags boost_system boost_filesystem m hdf5_hl hdf5 caffe +LIBRARIES += glog gflags boost_system boost_filesystem m hdf5_hl hdf5 # handle IO dependencies USE_LEVELDB ?= 1 @@ -377,8 +380,10 @@ ifeq ($(USE_PKG_CONFIG), 1) else PKG_CONFIG := endif +# LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(PKG_CONFIG) \ +# $(foreach library,$(LIBRARIES),-l$(library)) -Wl,-rpath=$(CAFFE_DIR)/lib LDFLAGS += $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(PKG_CONFIG) \ - $(foreach library,$(LIBRARIES),-l$(library)) -Wl,-rpath=$(CAFFE_DIR)/lib + $(foreach library,$(LIBRARIES),-l$(library)) ############################## # Define build targets diff --git a/README.md b/README.md index 42546761..9da4bf5e 100644 --- a/README.md +++ b/README.md @@ -62,16 +62,17 @@ The pose estimation work is based on the C++ code from [the ECCV 2016 demo](http ## Contents 1. [Installation, Reinstallation and Uninstallation](#installation-reinstallation-and-uninstallation) -2. [Quick Start](#quick-start) +2. [Custom Caffe](#custom-caffe) +3. [Quick Start](#quick-start) 1. [Demo](#demo) 2. [OpenPose Wrapper](#openpose-wrapper) 3. [OpenPose Library](#openpose-library) -3. [Output](#output) +4. [Output](#output) 1. [Output Format](#output-format) 2. [Reading Saved Results](#reading-saved-results) -4. [OpenPose Benchmark](#openpose-benchmark) -5. [Send Us Your Feedback!](#send-us-your-feedback) -6. [Citation](#citation) +5. [OpenPose Benchmark](#openpose-benchmark) +6. [Send Us Your Feedback!](#send-us-your-feedback) +7. [Citation](#citation) @@ -80,6 +81,19 @@ You can find the installation, reinstallation and uninstallation steps on: [doc/ +## Custom Caffe +We only modified some Caffe compilation flags and minor details. You can use use your own Caffe distribution, these are the files we added and modified: + +1. Added files: `install_caffe.sh`; as well as `Makefile.config.Ubuntu14.example`, `Makefile.config.Ubuntu16.example`, `Makefile.config.Ubuntu14_cuda_7.example` and `Makefile.config.Ubuntu16_cuda_7.example` (extracted from `Makefile.config.example`). Basically, you must enable cuDNN. +2. Edited file: Makefile. Search for "# OpenPose: " to find the edited code. We basically added the C++11 flag to avoid issues in some old computers. +3. Optional - deleted Caffe file: `Makefile.config.example`. +4. In order to link it to OpenPose: + 1. Run `make all && make distribute` in your Caffe version. + 2. Open the OpenPose Makefile config file: `./Makefile.config.UbuntuX.example` (where X depends on your OS and CUDA version). + 3. Modify the Caffe folder directory variable (`CAFFE_DIR`) to your custom Caffe `distribute` folder location in the previous OpenPose Makefile config file. + + + ## Quick Start Most users cases should not need to dive deep into the library, they might just be able to use the [Demo](#demo) or the simple [OpenPose Wrapper](#openpose-wrapper). So you can most probably skip the library details in [OpenPose Library](#openpose-library). @@ -168,16 +182,6 @@ We use standard formats (JSON, XML, PNG, JPG, ...) to save our results, so there -## Custom Caffe -We only modified some Caffe compilation flags and minor details. You can use use your own Caffe distribution, these are the files we added and modified: - -1. Added files: `install_caffe.sh`; as well as `Makefile.config.Ubuntu14.example`, `Makefile.config.Ubuntu16.example`, `Makefile.config.Ubuntu14_cuda_7.example` and `Makefile.config.Ubuntu16_cuda_7.example` (extracted from `Makefile.config.example`). Basically, you must enable cuDNN. -2. Edited file: Makefile. Search for "# OpenPose: " to find the edited code. We basically added the C++11 flag to avoid issues in some old computers. -3. Optional - deleted Caffe file: `Makefile.config.example`. -4. Finally, run `make all && make distribute` in your Caffe version and modify the Caffe directory variable in our Makefile config file: `./Makefile.config.UbuntuX.example` (where X is 14 or 16 depending on your Ubuntu version), set the `CAFFE_DIR` parameter to the path where both the `include` and `lib` Caffe folders are located. - - - ## OpenPose Benchmark Initial library running time benchmark on [OpenPose Benchmark](https://docs.google.com/spreadsheets/d/1-DynFGvoScvfWDA1P4jDInCkbD4lg0IKOYbXgEq0sK0/edit#gid=0). You can comment in that document with your graphics card model and running time for that model, and we will add your results to the benchmark!