kandi background
Explore Kits

caffe_rtpose | Realtime C code for multi-person pose estimation | Computer Vision library

 by   CMU-Perceptual-Computing-Lab C++ Version: Current License: Non-SPDX

 by   CMU-Perceptual-Computing-Lab C++ Version: Current License: Non-SPDX

Download this library from

kandi X-RAY | caffe_rtpose Summary

caffe_rtpose is a C++ library typically used in Artificial Intelligence, Computer Vision applications. caffe_rtpose has no bugs, it has no vulnerabilities and it has low support. However caffe_rtpose has a Non-SPDX License. You can download it from GitHub.
C++ code repo for the ECCV 2016 demo, "Realtime Multiperson Pose Estimation", Zhe Cao, Shih-En Wei, Tomas Simon, Yaser Sheikh. Thanks Ginés Hidalgo Martínez for restructuring the code. The [full project repo](https://github.com/ZheC/Multi-Person-Pose-Estimation) includes matlab and python version, and training code. This project is under the terms of the [license](LICENSE).
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • caffe_rtpose has a low active ecosystem.
  • It has 350 star(s) with 197 fork(s). There are 44 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 4 open issues and 48 have been closed. On average issues are closed in 27 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of caffe_rtpose is current.
caffe_rtpose Support
Best in #Computer Vision
Average in #Computer Vision
caffe_rtpose Support
Best in #Computer Vision
Average in #Computer Vision

quality kandi Quality

  • caffe_rtpose has 0 bugs and 0 code smells.
caffe_rtpose Quality
Best in #Computer Vision
Average in #Computer Vision
caffe_rtpose Quality
Best in #Computer Vision
Average in #Computer Vision

securitySecurity

  • caffe_rtpose has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • caffe_rtpose code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
caffe_rtpose Security
Best in #Computer Vision
Average in #Computer Vision
caffe_rtpose Security
Best in #Computer Vision
Average in #Computer Vision

license License

  • caffe_rtpose has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
caffe_rtpose License
Best in #Computer Vision
Average in #Computer Vision
caffe_rtpose License
Best in #Computer Vision
Average in #Computer Vision

buildReuse

  • caffe_rtpose releases are not available. You will need to build from source code and install.
  • Installation instructions, examples and code snippets are available.
  • It has 5209 lines of code, 307 functions and 31 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
caffe_rtpose Reuse
Best in #Computer Vision
Average in #Computer Vision
caffe_rtpose Reuse
Best in #Computer Vision
Average in #Computer Vision
Top functions reviewed by kandi - BETA

kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here

Get all kandi verified functions for this library.

Get all kandi verified functions for this library.

caffe_rtpose Key Features

Realtime C++ code for multi-person pose estimation

caffe_rtpose Examples and Code Snippets

See all related Code Snippets

Quick Start

copy iconCopydownload iconDownload
chmod u+x install_caffe_and_cpm.sh
./install_caffe_and_cpm.sh

Running on a video:

copy iconCopydownload iconDownload
./build/examples/rtpose/rtpose.bin --video video_file.mp4

Running on your webcam:

copy iconCopydownload iconDownload
./build/examples/rtpose/rtpose.bin

Example:

copy iconCopydownload iconDownload
./build/examples/rtpose/rtpose.bin --video vid.mp4 --num_gpu 2 --no_frame_drops --write_frames output/ --write_json output/ --num_scales 3 --scale_gap 0.15

Output format:

copy iconCopydownload iconDownload
{
"version":0.1,
"bodies":[
{"joints":[1114.15,160.396,0.846207,...]},
{"joints":[...]},
]
}

Citation

copy iconCopydownload iconDownload
 @article{cao2016realtime,
title={Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields},
author={Zhe Cao and Tomas Simon and Shih-En Wei and Yaser Sheikh},
journal={arXiv preprint arXiv:1611.08050},
year={2016}
}

How to compile caffe_rtpose on OSX?

copy iconCopydownload iconDownload
std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5
F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @        0x10c7a89da  google::LogMessage::Fail()
    @        0x10c7a80d5  google::LogMessage::SendToLog()
    @        0x10c7a863b  google::LogMessage::Flush()
    @        0x10c7aba17  google::LogMessageFatal::~LogMessageFatal()
    @        0x10c7a8cc7  google::LogMessageFatal::~LogMessageFatal()
    @        0x1079481db  caffe::SyncedMemory::to_gpu()
    @        0x107947c9e  caffe::SyncedMemory::mutable_gpu_data()
    @        0x1079affba  caffe::CuDNNConvolutionLayer<>::Forward_gpu()
    @        0x107861331  caffe::Layer<>::Forward()
    @        0x107918016  caffe::Net<>::ForwardFromTo()
    @        0x1077a86f1  warmup()
    @        0x1077b211d  processFrame()
    @     0x7fff8b11899d  _pthread_body
    @     0x7fff8b11891a  _pthread_start
    @     0x7fff8b116351  thread_start
Abort trap: 6
./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"
std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5
F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @        0x10c7a89da  google::LogMessage::Fail()
    @        0x10c7a80d5  google::LogMessage::SendToLog()
    @        0x10c7a863b  google::LogMessage::Flush()
    @        0x10c7aba17  google::LogMessageFatal::~LogMessageFatal()
    @        0x10c7a8cc7  google::LogMessageFatal::~LogMessageFatal()
    @        0x1079481db  caffe::SyncedMemory::to_gpu()
    @        0x107947c9e  caffe::SyncedMemory::mutable_gpu_data()
    @        0x1079affba  caffe::CuDNNConvolutionLayer<>::Forward_gpu()
    @        0x107861331  caffe::Layer<>::Forward()
    @        0x107918016  caffe::Net<>::ForwardFromTo()
    @        0x1077a86f1  warmup()
    @        0x1077b211d  processFrame()
    @     0x7fff8b11899d  _pthread_body
    @     0x7fff8b11891a  _pthread_start
    @     0x7fff8b116351  thread_start
Abort trap: 6
./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"
std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5
F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @        0x10c7a89da  google::LogMessage::Fail()
    @        0x10c7a80d5  google::LogMessage::SendToLog()
    @        0x10c7a863b  google::LogMessage::Flush()
    @        0x10c7aba17  google::LogMessageFatal::~LogMessageFatal()
    @        0x10c7a8cc7  google::LogMessageFatal::~LogMessageFatal()
    @        0x1079481db  caffe::SyncedMemory::to_gpu()
    @        0x107947c9e  caffe::SyncedMemory::mutable_gpu_data()
    @        0x1079affba  caffe::CuDNNConvolutionLayer<>::Forward_gpu()
    @        0x107861331  caffe::Layer<>::Forward()
    @        0x107918016  caffe::Net<>::ForwardFromTo()
    @        0x1077a86f1  warmup()
    @        0x1077b211d  processFrame()
    @     0x7fff8b11899d  _pthread_body
    @     0x7fff8b11891a  _pthread_start
    @     0x7fff8b116351  thread_start
Abort trap: 6
./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"
std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5
F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @        0x10c7a89da  google::LogMessage::Fail()
    @        0x10c7a80d5  google::LogMessage::SendToLog()
    @        0x10c7a863b  google::LogMessage::Flush()
    @        0x10c7aba17  google::LogMessageFatal::~LogMessageFatal()
    @        0x10c7a8cc7  google::LogMessageFatal::~LogMessageFatal()
    @        0x1079481db  caffe::SyncedMemory::to_gpu()
    @        0x107947c9e  caffe::SyncedMemory::mutable_gpu_data()
    @        0x1079affba  caffe::CuDNNConvolutionLayer<>::Forward_gpu()
    @        0x107861331  caffe::Layer<>::Forward()
    @        0x107918016  caffe::Net<>::ForwardFromTo()
    @        0x1077a86f1  warmup()
    @        0x1077b211d  processFrame()
    @     0x7fff8b11899d  _pthread_body
    @     0x7fff8b11891a  _pthread_start
    @     0x7fff8b116351  thread_start
Abort trap: 6
./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"

See all related Code Snippets

Community Discussions

Trending Discussions on caffe_rtpose
  • How to compile caffe_rtpose on OSX?
Trending Discussions on caffe_rtpose

QUESTION

How to compile caffe_rtpose on OSX?

Asked 2017-Apr-01 at 10:26

I've recently bumped spotted caffe_rtpose and I tried to compile and run the example. Unfortunately I'm super experienced with c++ so I ran into a lot of issues compiling and linking.

I've tried tweaking the Makefile config (modified from the existing Ubuntu config). (I'm using a system running OSX 10.11.5 with an nVidia GeForce 750M and I have installed CUDA 7.5 and libcudnn):

## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
#   You should not set this flag if you will be reading LMDBs with any
#   possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_50,code=compute_50 \
        -gencode arch=compute_52,code=sm_52 \
        # -gencode arch=compute_60,code=sm_60 \
        # -gencode arch=compute_61,code=sm_61
# Deprecated
#CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
#       -gencode arch=compute_20,code=sm_21 \
#       -gencode arch=compute_30,code=sm_30 \
#       -gencode arch=compute_35,code=sm_35 \
#       -gencode arch=compute_50,code=sm_50 \
#       -gencode arch=compute_50,code=compute_50

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
BLAS_INCLUDE := /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/
BLAS_LIB := /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
        /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
        # $(ANACONDA_HOME)/include/python2.7 \
        # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
# INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
# LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
# Q ?= @

And this is the modified version of the install_caffe_and_cpm_osx.sh script:

#!/bin/bash



echo "------------------------- INSTALLING CAFFE AND CPM -------------------------"
echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail."



function exitIfError {
    if [[ $? -ne 0 ]] ; then
        echo ""
        echo "------------------------- -------------------------"
        echo "Errors detected. Exiting script. The software might have not been successfully installed."
        echo "------------------------- -------------------------"
        exit 1
    fi
}



# echo "------------------------- Checking Ubuntu Version -------------------------"
# ubuntu_version="$(lsb_release -r)"
# echo "Ubuntu $ubuntu_version"
# if [[ $ubuntu_version == *"14."* ]]; then
#     ubuntu_le_14=true
# elif [[ $ubuntu_version == *"16."* || $ubuntu_version == *"15."* || $ubuntu_version == *"17."* || $ubuntu_version == *"18."* ]]; then
#     ubuntu_le_14=false
# else
#     echo "Ubuntu release older than version 14. This installation script might fail."
#     ubuntu_le_14=true
# fi
# exitIfError
# echo "------------------------- Ubuntu Version Checked -------------------------"
# echo ""



echo "------------------------- Checking Number of Processors -------------------------"
NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
echo "$NUM_CORES cores"
exitIfError
echo "------------------------- Number of Processors Checked -------------------------"
echo ""



echo "------------------------- Installing some Caffe Dependencies -------------------------"
# Basic
# sudo apt-get --assume-yes update
# sudo apt-get --assume-yes install build-essential
#General dependencies
brew install protobuf leveldb snappy hdf5
# with Python pycaffe needs dependencies built from source - from http://caffe.berkeleyvision.org/install_osx.html
# brew install --build-from-source --with-python -vd protobuf
# brew install --build-from-source -vd boost boost-python
# without Python the usual installation suffices
brew install boost
# sudo apt-get --assume-yes install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler
# sudo apt-get --assume-yes install --no-install-recommends libboost-all-dev
# Remaining dependencies, 14.04
brew install gflags glog lmdb
# if [[ $ubuntu_le_14 == true ]]; then
#     sudo apt-get --assume-yes install libgflags-dev libgoogle-glog-dev liblmdb-dev
# fi
# OpenCV 2.4
# sudo apt-get --assume-yes install libopencv-dev
exitIfError
echo "------------------------- Some Caffe Dependencies Installed -------------------------"
echo ""



echo "------------------------- Compiling Caffe & CPM -------------------------"
cp Makefile.config.OSX.10.11.5.example Makefile.config
make all -j$NUM_CORES
# make test -j$NUM_CORES
# make runtest -j$NUM_CORES
exitIfError
echo "------------------------- Caffe & CPM Compiled -------------------------"
echo ""


# echo "------------------------- Installing CPM -------------------------"
# echo "Compiled"
# exitIfError
# echo "------------------------- CPM Installed -------------------------"
# echo ""



echo "------------------------- Downloading CPM Models -------------------------"
models_folder="./model/"
# COCO
coco_folder="$models_folder"coco/""
coco_model="$coco_folder"pose_iter_440000.caffemodel""
if [ ! -f $coco_model ]; then
    wget http://posefs1.perception.cs.cmu.edu/Users/tsimon/Projects/coco/data/models/coco/pose_iter_440000.caffemodel -P $coco_folder
fi
exitIfError
# MPI
mpi_folder="$models_folder"mpi/""
mpi_model="$mpi_folder"pose_iter_160000.caffemodel""
if [ ! -f $mpi_model ]; then
    wget http://posefs1.perception.cs.cmu.edu/Users/tsimon/Projects/coco/data/models/mpi/pose_iter_160000.caffemodel -P $mpi_folder
fi
exitIfError
echo "Models downloaded"
echo "------------------------- CPM Models Downloaded -------------------------"
echo ""



echo "------------------------- CAFFE AND CPM INSTALLED -------------------------"
echo ""

But I get this error:

examples/rtpose/rtpose.cpp:1088:22: error: variable length array of non-POD element type 'Frame'
    Frame frame_batch[BATCH_SIZE];

I've tried swapping the array for a vector:

std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);

That seems to take care of that compile error, but now I get a linker error: ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've searched for lib lib gomp and found a few related posts on caffe and OpenMP mentioning issues with clang on OSX and OpenMP. What I tried:

  1. Following this post I've installed gcc 4.9 with homebrew (as the homebrew formula for gcc 5 installs 5.9 which might be too high?)
  2. I've set -fopenmp=libomp based on Andrey Bokhanko's answer: this didn't work for me ++-4.9: error: unrecognized command line option '-fopenmp=libomp'

I could download and build Caffe separately using the official instructions, but I can't seem to figure out how to compile this awesome looking demo. Unfortunately I'm not experienced with c++ and OpenMP so I could really use your suggestions here. Thank you

Update: I've tried Mark Setchell's helpful suggestion of installing llvm via clang. I've updated the Makefile config to use

CUSTOM_CXX := /usr/local/opt/llvm/bin/clang++

but CUDA doesn't like it:

nvcc fatal   : The version ('30801') of the host compiler ('clang') is not supported

I've tried compiling with CPU_ONLY but I still get CUDA errors:

examples/rtpose/rtpose.cpp:235:5: error: use of undeclared identifier 'cudaMalloc'
    cudaMalloc(&net_copies[device_id].canvas, DISPLAY_RESOLUTION_WIDTH * DISPLAY_RESOLUTION_HEIGHT * 3 * sizeof(float));
    ^
examples/rtpose/rtpose.cpp:236:5: error: use of undeclared identifier 'cudaMalloc'
    cudaMalloc(&net_copies[device_id].joints, MAX_NUM_PARTS*3*MAX_PEOPLE * sizeof(float) );
    ^
examples/rtpose/rtpose.cpp:1130:146: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
                cudaMemcpy(net_copies[tid].canvas, frame.data_for_mat, DISPLAY_RESOLUTION_WIDTH * DISPLAY_RESOLUTION_HEIGHT * 3 * sizeof(float), cudaMemcpyHostToDevice);
                                                                                                                                                 ^
examples/rtpose/rtpose.cpp:1136:108: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
                cudaMemcpy(pointer + 0 * offset, frame_batch[0].data, BATCH_SIZE * offset * sizeof(float), cudaMemcpyHostToDevice);
                                                                                                           ^
examples/rtpose/rtpose.cpp:1178:13: error: use of undeclared identifier 'cudaMemcpyHostToDevice'
            cudaMemcpyHostToDevice);
            ^
examples/rtpose/rtpose.cpp:1192:155: error: use of undeclared identifier 'cudaMemcpyDeviceToHost'
                cudaMemcpy(frame_batch[n].data_for_mat, net_copies[tid].canvas, DISPLAY_RESOLUTION_HEIGHT * DISPLAY_RESOLUTION_WIDTH * 3 * sizeof(float), cudaMemcpyDeviceToHost);
                                                                                                                                                          ^
examples/rtpose/rtpose.cpp:1202:155: error: use of undeclared identifier 'cudaMemcpyDeviceToHost'
                cudaMemcpy(frame_batch[n].data_for_mat, net_copies[tid].canvas, DISPLAY_RESOLUTION_HEIGHT * DISPLAY_RESOLUTION_WIDTH * 3 * sizeof(float), cudaMemcpyDeviceToHost);

I'm no expert, but having a quick scan through the code, I don't see how the CPU_ONLY version will work with the cuda calls.

Having another look at the caffe OSX Installation guide, I may try the route >not for the faint of heart

ANSWER

Answered 2017-Apr-01 at 10:26

I have finally managed to compile the rtpose example.

Here's what I did:

Swapped the Frame array for a vector in examples/rtpose/rtpose.cpp, as mentioned above:

std::vector<Frame> frame_batch;
    std::cout << "allocating " << BATCH_SIZE << " frames" << std::endl;
    frame_batch.reserve(BATCH_SIZE);

Used the default clang++ compiler, after failed attempts at using gcc++-4.9 and Homebrew installed LLVM's clang++, but removed the -fopenmp flags and the -pthread linker flag, not the compiler flag, based on this answer

After the compile finished, I tried to run it, but got a libjpeg related error:

dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Trace/BPT trap: 5

The workaround was mdemirst's answer. I made a backup of the old symbolic links just in case though. I did symlink libjpeg/libpng/libtiff/libgif from ImageIO.framework.

I've commited the above config/setup script on github.

Now that the example is compiled, I still can't run it, possibly due to not enough GPU memory:

F0331 02:02:16.231935 528384 syncedmem.cpp:56] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @        0x10c7a89da  google::LogMessage::Fail()
    @        0x10c7a80d5  google::LogMessage::SendToLog()
    @        0x10c7a863b  google::LogMessage::Flush()
    @        0x10c7aba17  google::LogMessageFatal::~LogMessageFatal()
    @        0x10c7a8cc7  google::LogMessageFatal::~LogMessageFatal()
    @        0x1079481db  caffe::SyncedMemory::to_gpu()
    @        0x107947c9e  caffe::SyncedMemory::mutable_gpu_data()
    @        0x1079affba  caffe::CuDNNConvolutionLayer<>::Forward_gpu()
    @        0x107861331  caffe::Layer<>::Forward()
    @        0x107918016  caffe::Net<>::ForwardFromTo()
    @        0x1077a86f1  warmup()
    @        0x1077b211d  processFrame()
    @     0x7fff8b11899d  _pthread_body
    @     0x7fff8b11891a  _pthread_start
    @     0x7fff8b116351  thread_start
Abort trap: 6

I have tried dimming the settings down as much as possible:

./build/examples/rtpose/rtpose.bin -caffemodel ./model/coco/pose_iter_440000.caffemodel -caffeproto ./model/coco/pose_deploy_linevec.prototxt -camera_resolution "40x30" -camera 0 -resolution "40x30" -start_scale 0.1 -num_scales=0 -no_display true -net_resolution "16x16"

But to no avail. Actually running the example may be another question in itself.

Source https://stackoverflow.com/questions/43031790

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install caffe_rtpose

Required: CUDA & cuDNN installed on your machine. If you have installed OpenCV 2.4 in your system, go to step 3. If you are using OpenCV 3, uncomment the line # OPENCV_VERSION := 3 on the file Makefile.config.Ubuntu14.example (for Ubuntu 14) and/or Makefile.config.Ubuntu16.example (for Ubuntu 15 or 16). In addition, OpenCV 3 does not incorporate the opencv_contrib module by default. Assuming you have manually installed it and you need to use it, append opencv_contrib at the end of the line LIBRARIES += opencv_core opencv_highgui opencv_imgproc in the Makefile file. Build caffe & rtpose.bin + download the required caffe models (script tested on Ubuntu 14.04 & 16.04, it uses all the available cores in your machine):**.
Required: CUDA & cuDNN installed on your machine.
If you have installed OpenCV 2.4 in your system, go to step 3. If you are using OpenCV 3, uncomment the line # OPENCV_VERSION := 3 on the file Makefile.config.Ubuntu14.example (for Ubuntu 14) and/or Makefile.config.Ubuntu16.example (for Ubuntu 15 or 16). In addition, OpenCV 3 does not incorporate the opencv_contrib module by default. Assuming you have manually installed it and you need to use it, append opencv_contrib at the end of the line LIBRARIES += opencv_core opencv_highgui opencv_imgproc in the Makefile file.
Build caffe & rtpose.bin + download the required caffe models (script tested on Ubuntu 14.04 & 16.04, it uses all the available cores in your machine):**

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

Share this Page

share link
Reuse Pre-built Kits with caffe_rtpose
Consider Popular Computer Vision Libraries
Try Top Libraries by CMU-Perceptual-Computing-Lab
Compare Computer Vision Libraries with Highest Support
Compare Computer Vision Libraries with Highest Quality
Compare Computer Vision Libraries with Highest Security
Compare Computer Vision Libraries with Permissive License
Compare Computer Vision Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.