kandi background
Explore Kits

openpose | time multi-person keypoint detection library | Computer Vision library

 by   CMU-Perceptual-Computing-Lab C++ Version: v1.7.0 License: Non-SPDX

 by   CMU-Perceptual-Computing-Lab C++ Version: v1.7.0 License: Non-SPDX

kandi X-RAY | openpose Summary

openpose is a C++ library typically used in Artificial Intelligence, Computer Vision, Deep Learning, Pytorch, OpenCV applications. openpose has no bugs, it has no vulnerabilities and it has medium support. However openpose has a Non-SPDX License. You can download it from GitHub.
OpenPose has represented the first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints (in total 135 keypoints) on single images. It is authored by Ginés Hidalgo, Zhe Cao, Tomas Simon, Shih-En Wei, Yaadhav Raaj, Hanbyul Joo, and Yaser Sheikh. It is maintained by Ginés Hidalgo and Yaadhav Raaj. OpenPose would not be possible without the CMU Panoptic Studio dataset. We would also like to thank all the people who has helped OpenPose in any way.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • openpose has a medium active ecosystem.
  • It has 21768 star(s) with 6557 fork(s). There are 903 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 143 open issues and 1563 have been closed. On average issues are closed in 23 days. There are 4 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of openpose is v1.7.0
openpose Support
Best in #Computer Vision
Average in #Computer Vision
openpose Support
Best in #Computer Vision
Average in #Computer Vision

quality kandi Quality

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

securitySecurity

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

license License

  • openpose 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.
openpose License
Best in #Computer Vision
Average in #Computer Vision
openpose License
Best in #Computer Vision
Average in #Computer Vision

buildReuse

  • openpose releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
  • It has 27658 lines of code, 3 functions and 13 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
openpose Reuse
Best in #Computer Vision
Average in #Computer Vision
openpose 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.

openpose Key Features

Main Functionality: 2D real-time multi-person keypoint detection: 15, 18 or 25-keypoint body/foot keypoint estimation, including 6 foot keypoints. Runtime invariant to number of detected people. 2x21-keypoint hand keypoint estimation. Runtime depends on number of detected people. See OpenPose Training for a runtime invariant alternative. 70-keypoint face keypoint estimation. Runtime depends on number of detected people. See OpenPose Training for a runtime invariant alternative. 3D real-time single-person keypoint detection: 3D triangulation from multiple single views. Synchronization of Flir cameras handled. Compatible with Flir/Point Grey cameras. Calibration toolbox: Estimation of distortion, intrinsic, and extrinsic camera parameters. Single-person tracking for further speedup or visual smoothing.

Input: Image, video, webcam, Flir/Point Grey, IP camera, and support to add your own custom input source (e.g., depth camera).

Output: Basic image + keypoint display/saving (PNG, JPG, AVI, ...), keypoint saving (JSON, XML, YML, ...), keypoints as array class, and support to add your own custom output code (e.g., some fancy UI).

OS: Ubuntu (20, 18, 16, 14), Windows (10, 8), Mac OSX, Nvidia TX2.

Hardware compatibility: CUDA (Nvidia GPU), OpenCL (AMD GPU), and non-GPU (CPU-only) versions.

Usage Alternatives: Command-line demo for built-in functionality. C++ API and Python API for custom functionality. E.g., adding your custom inputs, pre-processing, post-posprocessing, and output steps.

openpose Examples and Code Snippets

See all related Code Snippets

Quick Start Overview

copy iconCopydownload iconDownload
# Ubuntu
./build/examples/openpose/openpose.bin

Citation

copy iconCopydownload iconDownload
@article{8765346,
  author = {Z. {Cao} and G. {Hidalgo Martinez} and T. {Simon} and S. {Wei} and Y. A. {Sheikh}},
  journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  title = {OpenPose: Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields},
  year = {2019}
}

@inproceedings{simon2017hand,
  author = {Tomas Simon and Hanbyul Joo and Iain Matthews and Yaser Sheikh},
  booktitle = {CVPR},
  title = {Hand Keypoint Detection in Single Images using Multiview Bootstrapping},
  year = {2017}
}

@inproceedings{cao2017realtime,
  author = {Zhe Cao and Tomas Simon and Shih-En Wei and Yaser Sheikh},
  booktitle = {CVPR},
  title = {Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields},
  year = {2017}
}

@inproceedings{wei2016cpm,
  author = {Shih-En Wei and Varun Ramakrishna and Takeo Kanade and Yaser Sheikh},
  booktitle = {CVPR},
  title = {Convolutional pose machines},
  year = {2016}
}

Why set STRINGS property for a CACHE variable?

copy iconCopydownload iconDownload
  set_property(CACHE DL_FRAMEWORK PROPERTY STRINGS CAFFE NV_CAFFE)

No output when trying to run a shell command from python

copy iconCopydownload iconDownload
import os
import subprocess
import time

os.chdir(
    r"C:\Users\Adam\Downloads\openpose-1.7.0-binaries-win64-cpu-python3.7-flir-3d\openpose"
)
for root, dirs, files in os.walk(
    r"C:\Users\Adam\Downloads\LIP_MPV_256_192\MPV_256_192\all\all\images\train"
):
    for d in dirs:
        print("got here")
        command = [
            "bin\\OpenPoseDemo.exe",
            "--image_dir",
            " C:\\Users\\Adam\\Downloads\\LIP_MPV_256_192\\MPV_256_192\\all\\all\\images\\train\\" + d,
            "--write_json",
            " C:\\Users\\Adam\\Downloads\\LIP_MPV_256_192\\MPV_256_192\\all\\all\\images\\pose_coco\\train\\"
            + d
        ]
        subprocess.run(args=command, shell=False, capture_output=True)
        time.sleep(5)

OpenCV: Comparing poses from webcam and image

copy iconCopydownload iconDownload
(J0[0] - J1[0])*(J0[0] - J1[0])
(J0[0] - J1[0])*(J0[0] - J1[0])*confidance
(J0[0] - J1[0])*(J0[0] - J1[0])
(J0[0] - J1[0])*(J0[0] - J1[0])*confidance

Save array with multiple columns to csv

copy iconCopydownload iconDownload
import numpy as np

a = [1,2,3,4,5,6,7,8,9]
b = []
for j in range(3):
    b2 = []
    for i in range(3):
        e =  a[3*j+i] # get_val(i)
        b2.append(e)
    b.append(b2)
print(np.asarray(b))
# [[1 2 3]
# [4 5 6]
# [7 8 9]]
a = []
n = 1
for j in range(1,4):
    b = []
    for i in range(1,4):
        b.append(n)
        n += 1
    a.append(b)
print(a)

How to Detect "human hand Pose" using OpenPose or any other alternatives in python and OpenCV?

copy iconCopydownload iconDownload
import cv2
import time
import numpy as np


protoFile = "hand/pose_deploy.prototxt"
weightsFile = "hand/pose_iter_102000.caffemodel"
nPoints = 22
POSE_PAIRS = [ [0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[0,9],[9,10],[10,11],[11,12],[0,13],[13,14],[14,15],[15,16],[0,17],[17,18],[18,19],[19,20] ]

threshold = 0.2


video_file = "videoMis.mp4"
cap = cv2.VideoCapture(video_file)
hasFrame, frame = cap.read()

frameWidth = frame.shape[1]
frameHeight = frame.shape[0]

aspect_ratio = frameWidth/frameHeight

inHeight = 368
inWidth = int(((aspect_ratio*inHeight)*8)//8)

vid_writer = cv2.VideoWriter('output.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 15, (frame.shape[1],frame.shape[0]))

net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
k = 0
while 1:
    k+=1
    t = time.time()
    hasFrame, frame = cap.read()
    frameCopy = np.copy(frame)
    if not hasFrame:
        cv2.waitKey()
        break

    inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inWidth, inHeight),
                              (0, 0, 0), swapRB=False, crop=False)

    net.setInput(inpBlob)

    output = net.forward()

    print("forward = {}".format(time.time() - t))

    # Empty list to store the detected keypoints
    points = []

    for i in range(nPoints):
        # confidence map of corresponding body's part.
        probMap = output[0, i, :, :]
        probMap = cv2.resize(probMap, (frameWidth, frameHeight))

        # Find global maxima of the probMap.
        minVal, prob, minLoc, point = cv2.minMaxLoc(probMap)

        if prob > threshold :
            cv2.circle(frameCopy, (int(point[0]), int(point[1])), 6, (0, 255, 255), thickness=-1, lineType=cv2.FILLED)
            cv2.putText(frameCopy, "{}".format(i), (int(point[0]), int(point[1])), cv2.FONT_HERSHEY_SIMPLEX, .8, (0, 0, 255), 2, lineType=cv2.LINE_AA)

            # Add the point to the list if the probability is greater than the threshold
            points.append((int(point[0]), int(point[1])))
        else :
            points.append(None)

    # Draw Skeleton
    for pair in POSE_PAIRS:
        partA = pair[0]
        partB = pair[1]

        if points[partA] and points[partB]:
            cv2.line(frame, points[partA], points[partB], (0, 255, 255), 2, lineType=cv2.LINE_AA)
            cv2.circle(frame, points[partA], 5, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
            cv2.circle(frame, points[partB], 5, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)

    print("Time Taken for frame = {}".format(time.time() - t))

    # cv2.putText(frame, "time taken = {:.2f} sec".format(time.time() - t), (50, 50), cv2.FONT_HERSHEY_COMPLEX, .8, (255, 50, 0), 2, lineType=cv2.LINE_AA)
    # cv2.putText(frame, "Hand Pose using OpenCV", (50, 50), cv2.FONT_HERSHEY_COMPLEX, 1, (255, 50, 0), 2, lineType=cv2.LINE_AA)
    cv2.imshow('Output-Skeleton', frame)
    # cv2.imwrite("video_output/{:03d}.jpg".format(k), frame)
    key = cv2.waitKey(1)
    if key == 27:
        break

    print("total = {}".format(time.time() - t))

    vid_writer.write(frame)

vid_writer.release()

from __future__ import division
import cv2
import time
import numpy as np

protoFile = "hand/pose_deploy.prototxt"
weightsFile = "hand/pose_iter_102000.caffemodel"
nPoints = 22
POSE_PAIRS = [ [0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[0,9],[9,10],[10,11],[11,12],[0,13],[13,14],[14,15],[15,16],[0,17],[17,18],[18,19],[19,20] ]
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)

frame = cv2.imread("image.jpg")
frameCopy = np.copy(frame)
frameWidth = frame.shape[1]
frameHeight = frame.shape[0]
aspect_ratio = frameWidth/frameHeight

threshold = 0.1

t = time.time()
# input image dimensions for the network
inHeight = 368
inWidth = int(((aspect_ratio*inHeight)*8)//8)
inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inWidth, inHeight), (0, 0, 0), swapRB=False, crop=False)

net.setInput(inpBlob)

output = net.forward()
print("time taken by network : {:.3f}".format(time.time() - t))

# Empty list to store the detected keypoints
points = []

for i in range(nPoints):
    # confidence map of corresponding body's part.
    probMap = output[0, i, :, :]
    probMap = cv2.resize(probMap, (frameWidth, frameHeight))

    # Find global maxima of the probMap.
    minVal, prob, minLoc, point = cv2.minMaxLoc(probMap)

    if prob > threshold :
        cv2.circle(frameCopy, (int(point[0]), int(point[1])), 8, (0, 255, 255), thickness=-1, lineType=cv2.FILLED)
        cv2.putText(frameCopy, "{}".format(i), (int(point[0]), int(point[1])), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, lineType=cv2.LINE_AA)

        # Add the point to the list if the probability is greater than the threshold
        points.append((int(point[0]), int(point[1])))
    else :
        points.append(None)

# Draw Skeleton
for pair in POSE_PAIRS:
    partA = pair[0]
    partB = pair[1]

    if points[partA] and points[partB]:
        cv2.line(frame, points[partA], points[partB], (0, 255, 255), 2)
        cv2.circle(frame, points[partA], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
        cv2.circle(frame, points[partB], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)


cv2.imshow('Output-Keypoints', frameCopy)
cv2.imshow('Output-Skeleton', frame)


cv2.imwrite('Output-Keypoints.jpg', frameCopy)
cv2.imwrite('Output-Skeleton.jpg', frame)

print("Total time taken : {:.3f}".format(time.time() - t))

cv2.waitKey(0)
import cv2
import time
import numpy as np


protoFile = "hand/pose_deploy.prototxt"
weightsFile = "hand/pose_iter_102000.caffemodel"
nPoints = 22
POSE_PAIRS = [ [0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[0,9],[9,10],[10,11],[11,12],[0,13],[13,14],[14,15],[15,16],[0,17],[17,18],[18,19],[19,20] ]

threshold = 0.2


video_file = "videoMis.mp4"
cap = cv2.VideoCapture(video_file)
hasFrame, frame = cap.read()

frameWidth = frame.shape[1]
frameHeight = frame.shape[0]

aspect_ratio = frameWidth/frameHeight

inHeight = 368
inWidth = int(((aspect_ratio*inHeight)*8)//8)

vid_writer = cv2.VideoWriter('output.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 15, (frame.shape[1],frame.shape[0]))

net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
k = 0
while 1:
    k+=1
    t = time.time()
    hasFrame, frame = cap.read()
    frameCopy = np.copy(frame)
    if not hasFrame:
        cv2.waitKey()
        break

    inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inWidth, inHeight),
                              (0, 0, 0), swapRB=False, crop=False)

    net.setInput(inpBlob)

    output = net.forward()

    print("forward = {}".format(time.time() - t))

    # Empty list to store the detected keypoints
    points = []

    for i in range(nPoints):
        # confidence map of corresponding body's part.
        probMap = output[0, i, :, :]
        probMap = cv2.resize(probMap, (frameWidth, frameHeight))

        # Find global maxima of the probMap.
        minVal, prob, minLoc, point = cv2.minMaxLoc(probMap)

        if prob > threshold :
            cv2.circle(frameCopy, (int(point[0]), int(point[1])), 6, (0, 255, 255), thickness=-1, lineType=cv2.FILLED)
            cv2.putText(frameCopy, "{}".format(i), (int(point[0]), int(point[1])), cv2.FONT_HERSHEY_SIMPLEX, .8, (0, 0, 255), 2, lineType=cv2.LINE_AA)

            # Add the point to the list if the probability is greater than the threshold
            points.append((int(point[0]), int(point[1])))
        else :
            points.append(None)

    # Draw Skeleton
    for pair in POSE_PAIRS:
        partA = pair[0]
        partB = pair[1]

        if points[partA] and points[partB]:
            cv2.line(frame, points[partA], points[partB], (0, 255, 255), 2, lineType=cv2.LINE_AA)
            cv2.circle(frame, points[partA], 5, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
            cv2.circle(frame, points[partB], 5, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)

    print("Time Taken for frame = {}".format(time.time() - t))

    # cv2.putText(frame, "time taken = {:.2f} sec".format(time.time() - t), (50, 50), cv2.FONT_HERSHEY_COMPLEX, .8, (255, 50, 0), 2, lineType=cv2.LINE_AA)
    # cv2.putText(frame, "Hand Pose using OpenCV", (50, 50), cv2.FONT_HERSHEY_COMPLEX, 1, (255, 50, 0), 2, lineType=cv2.LINE_AA)
    cv2.imshow('Output-Skeleton', frame)
    # cv2.imwrite("video_output/{:03d}.jpg".format(k), frame)
    key = cv2.waitKey(1)
    if key == 27:
        break

    print("total = {}".format(time.time() - t))

    vid_writer.write(frame)

vid_writer.release()

from __future__ import division
import cv2
import time
import numpy as np

protoFile = "hand/pose_deploy.prototxt"
weightsFile = "hand/pose_iter_102000.caffemodel"
nPoints = 22
POSE_PAIRS = [ [0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[0,9],[9,10],[10,11],[11,12],[0,13],[13,14],[14,15],[15,16],[0,17],[17,18],[18,19],[19,20] ]
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)

frame = cv2.imread("image.jpg")
frameCopy = np.copy(frame)
frameWidth = frame.shape[1]
frameHeight = frame.shape[0]
aspect_ratio = frameWidth/frameHeight

threshold = 0.1

t = time.time()
# input image dimensions for the network
inHeight = 368
inWidth = int(((aspect_ratio*inHeight)*8)//8)
inpBlob = cv2.dnn.blobFromImage(frame, 1.0 / 255, (inWidth, inHeight), (0, 0, 0), swapRB=False, crop=False)

net.setInput(inpBlob)

output = net.forward()
print("time taken by network : {:.3f}".format(time.time() - t))

# Empty list to store the detected keypoints
points = []

for i in range(nPoints):
    # confidence map of corresponding body's part.
    probMap = output[0, i, :, :]
    probMap = cv2.resize(probMap, (frameWidth, frameHeight))

    # Find global maxima of the probMap.
    minVal, prob, minLoc, point = cv2.minMaxLoc(probMap)

    if prob > threshold :
        cv2.circle(frameCopy, (int(point[0]), int(point[1])), 8, (0, 255, 255), thickness=-1, lineType=cv2.FILLED)
        cv2.putText(frameCopy, "{}".format(i), (int(point[0]), int(point[1])), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, lineType=cv2.LINE_AA)

        # Add the point to the list if the probability is greater than the threshold
        points.append((int(point[0]), int(point[1])))
    else :
        points.append(None)

# Draw Skeleton
for pair in POSE_PAIRS:
    partA = pair[0]
    partB = pair[1]

    if points[partA] and points[partB]:
        cv2.line(frame, points[partA], points[partB], (0, 255, 255), 2)
        cv2.circle(frame, points[partA], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
        cv2.circle(frame, points[partB], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)


cv2.imshow('Output-Keypoints', frameCopy)
cv2.imshow('Output-Skeleton', frame)


cv2.imwrite('Output-Keypoints.jpg', frameCopy)
cv2.imwrite('Output-Skeleton.jpg', frame)

print("Total time taken : {:.3f}".format(time.time() - t))

cv2.waitKey(0)

CMake: unsupported GNU version -- gcc versions later than 8 are not supported

copy iconCopydownload iconDownload
$ sudo apt remove gcc
$ sudo apt-get install gcc-7 g++-7 -y
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/g++
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/cc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/c++
$ gcc --version
gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake after downgrading GCC 9.3.0 to 7 for openpose

copy iconCopydownload iconDownload
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/cc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/c++

installing Boost for CMake in OpenPose in Ubuntu 20.04

copy iconCopydownload iconDownload
$ sudo apt install  libboost-filesystem1.71-dev

How to force CMake to use a special version of Protobuf installed on system?

copy iconCopydownload iconDownload
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
        on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)

Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
##__conda_setup="$('/home/mona/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
##if [ $? -eq 0 ]; then
##    eval "$__conda_setup"
##else
##    if [ -f "/home/mona/anaconda3/etc/profile.d/conda.sh" ]; then
##        . "/home/mona/anaconda3/etc/profile.d/conda.sh"
##    else
##        export PATH="/home/mona/anaconda3/bin:$PATH"
##    fi
##fi
$ sudo apt-get install python3
$ sudo apt-get install python3-venv
$ python -m venv ~/venv/openpose
$ source ~/venv/openpose/bin/activate
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
        on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)

Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
##__conda_setup="$('/home/mona/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
##if [ $? -eq 0 ]; then
##    eval "$__conda_setup"
##else
##    if [ -f "/home/mona/anaconda3/etc/profile.d/conda.sh" ]; then
##        . "/home/mona/anaconda3/etc/profile.d/conda.sh"
##    else
##        export PATH="/home/mona/anaconda3/bin:$PATH"
##    fi
##fi
$ sudo apt-get install python3
$ sudo apt-get install python3-venv
$ python -m venv ~/venv/openpose
$ source ~/venv/openpose/bin/activate
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
        on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)

Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
##__conda_setup="$('/home/mona/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
##if [ $? -eq 0 ]; then
##    eval "$__conda_setup"
##else
##    if [ -f "/home/mona/anaconda3/etc/profile.d/conda.sh" ]; then
##        . "/home/mona/anaconda3/etc/profile.d/conda.sh"
##    else
##        export PATH="/home/mona/anaconda3/bin:$PATH"
##    fi
##fi
$ sudo apt-get install python3
$ sudo apt-get install python3-venv
$ python -m venv ~/venv/openpose
$ source ~/venv/openpose/bin/activate
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
        on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)

Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
##__conda_setup="$('/home/mona/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
##if [ $? -eq 0 ]; then
##    eval "$__conda_setup"
##else
##    if [ -f "/home/mona/anaconda3/etc/profile.d/conda.sh" ]; then
##        . "/home/mona/anaconda3/etc/profile.d/conda.sh"
##    else
##        export PATH="/home/mona/anaconda3/bin:$PATH"
##    fi
##fi
$ sudo apt-get install python3
$ sudo apt-get install python3-venv
$ python -m venv ~/venv/openpose
$ source ~/venv/openpose/bin/activate

Could NOT find Glog (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)

copy iconCopydownload iconDownload
$ sudo apt install libgoogle-glog-dev 
$ sudo apt-get install libgflags-dev
$ sudo apt install libgoogle-glog-dev
$ sudo apt-get install protobuf-compiler libprotobuf-dev
$ sudo apt install libgoogle-glog-dev 
$ sudo apt-get install libgflags-dev
$ sudo apt install libgoogle-glog-dev
$ sudo apt-get install protobuf-compiler libprotobuf-dev
 if (NOT GLOG_FOUND)
    message(FATAL_ERROR "Glog not found. Install Glog from the command line using the command(s) -\
      sudo apt-get install libgoogle-glog-dev")
  endif (NOT GLOG_FOUND)

  if (NOT GFLAGS_FOUND)
    message(FATAL_ERROR "GFlags not found. Install GFlags from the command line using the command(s) --\
      sudo apt-get install libgflags-dev")
  endif (NOT GFLAGS_FOUND)

  if (NOT OpenCV_FOUND)
    message(FATAL_ERROR "OpenCV not found. Install OpenCV from the command line using the command(s) --\
      sudo apt-get install libopencv-dev")
  endif (NOT OpenCV_FOUND)

See all related Code Snippets

Community Discussions

Trending Discussions on openpose
  • Why set STRINGS property for a CACHE variable?
  • Clang failing to find header files in non-standard location
  • How do I get eulerangles from two Vector3 coordinates based on openpose 3d?
  • No output when trying to run a shell command from python
  • OpenCV: Comparing poses from webcam and image
  • Save array with multiple columns to csv
  • How to Detect "human hand Pose" using OpenPose or any other alternatives in python and OpenCV?
  • CMake: unsupported GNU version -- gcc versions later than 8 are not supported
  • CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake after downgrading GCC 9.3.0 to 7 for openpose
  • installing Boost for CMake in OpenPose in Ubuntu 20.04
Trending Discussions on openpose

QUESTION

Why set STRINGS property for a CACHE variable?

Asked 2021-Aug-23 at 10:08

Well I always had troubles understanding the cmake doc, but concerning the set_property I cant get it, especially in this example, taken from the CMakeLists of Openpose.

# Select the DL Framework
set(DL_FRAMEWORK CAFFE CACHE STRING "Select Deep Learning Framework.")
if (WIN32)
  set_property(CACHE DL_FRAMEWORK PROPERTY STRINGS CAFFE)
else (WIN32)
  set_property(CACHE DL_FRAMEWORK PROPERTY STRINGS CAFFE NV_CAFFE)
  # set_property(CACHE DL_FRAMEWORK PROPERTY STRINGS CAFFE NV_CAFFE PYTORCH TENSORFLOW)
endif (WIN32)

# Suboptions for Caffe DL Framework
include(CMakeDependentOption)
if (${DL_FRAMEWORK} MATCHES "CAFFE" OR ${DL_FRAMEWORK} MATCHES "NV_CAFFE")
  CMAKE_DEPENDENT_OPTION(BUILD_CAFFE "Build Caffe as part of OpenPose." ON
    "DL_FRAMEWORK" ON)
  # OpenPose flags
  add_definitions(-DUSE_CAFFE)
  # Nvidia NVCaffe
  if (${DL_FRAMEWORK} MATCHES "NV_CAFFE")
      MESSAGE(STATUS "Using NVIDIA NVCaffe")
      add_definitions(-DNV_CAFFE)
  endif (${DL_FRAMEWORK} MATCHES "NV_CAFFE")
endif (${DL_FRAMEWORK} MATCHES "CAFFE" OR ${DL_FRAMEWORK} MATCHES "NV_CAFFE")

I do understand the CACHE variable, but what is the effect of the two set_property, as the variable ${DL_FRAMEWORK} seems to be checked to plain text like "CAFFE" or "NV_CAFFE".

Here is the complete CMakeLists.txt: https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/CMakeLists.txt

I may also misunderstand how properties are working then.

Thanks for your time!

ANSWER

Answered 2021-Aug-17 at 18:10

The command

  set_property(CACHE DL_FRAMEWORK PROPERTY STRINGS CAFFE NV_CAFFE)

Sets STRINGS property for the CACHE variable DL_FRAMEWORK.

If one configures the project with CMake GUI, then the first configuration is usually performed without any setting of the variables.

After that first configuration one could desire to set(change) the variable DL_FRAMEWORK. And STRING provides a list of values which will be suggested. So one doesn't need to type e.g. "NV_CAFFE" but could select it from the list.

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

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

Vulnerabilities

No vulnerabilities reported

Install openpose

If you want to use OpenPose without installing or writing any code, simply download and use the latest Windows portable version of OpenPose!. Otherwise, you could build OpenPose from source. See the installation doc for all the alternatives.
Simply use the OpenPose Demo from your favorite command-line tool (e.g., Windows PowerShell or Ubuntu Terminal). E.g., this example runs OpenPose on your webcam and displays the body keypoints:. You can also add any of the available flags in any order. E.g., the following example runs on a video (--video {PATH}), enables face (--face) and hands (--hand), and saves the output keypoints on JSON files on disk (--write_json {PATH}). Optionally, you can also extend OpenPose's functionality from its Python and C++ APIs. After installing OpenPose, check its official doc for a quick overview of all the alternatives and tutorials.

Support

Our library is open source for research purposes, and we want to improve it! So let us know (create a new GitHub issue or pull request, email us, etc.) if you...

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 openpose
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.