提交 24d29e59 编写于 作者: G gineshidalgo99

Changed VS 2017 doc

上级 9ddcaf35
......@@ -133,7 +133,7 @@ You just need to remove the OpenPose folder, by default called `openpose/`. E.g.
### Installation - Library
1. Install the pre-requisites:
1. Microsoft Visual Studio (VS) 2015 Enterprise Update 3. If Visual Studio 2017 Community is desired, we do not support it, but it might be compiled by firstly [enabling CUDA 8.0](https://stackoverflow.com/questions/43745099/using-cuda-with-visual-studio-2017?answertab=active#tab-top). VS Enterprise Update 1 will give some compiler errors and VS 2015 Community has not been tested.
1. Microsoft Visual Studio (VS) 2015 Enterprise Update 3. If Visual Studio 2017 Community is desired, we do not support it, but it might be compiled by firstly [enabling CUDA 8.0 in VS2017](https://stackoverflow.com/questions/43745099/using-cuda-with-visual-studio-2017?answertab=active#tab-top). VS Enterprise Update 1 will give some compiler errors and VS 2015 Community has not been tested.
2. [CUDA 8](https://developer.nvidia.com/cuda-downloads): Install it on the default location, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`. Otherwise, modify the Visual Studio project solution accordingly. Install CUDA 8.0 after Visual Studio 2015 is installed to assure that the CUDA installation will generate all necessary files for VS. If CUDA was already installed, re-install it after installing VS!
3. [cuDNN 5.1](https://developer.nvidia.com/cudnn): Once you have downloaded it, just unzip it and copy (merge) the contents on the CUDA folder, `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0`.
2. Download the OpenPose dependencies and models (body, face and hand models) by double-clicking on `{openpose_path}\windows\download_3rdparty_and_models.bat`. Alternatively, you might prefer to download them manually:
......
......@@ -13,7 +13,7 @@ namespace op
MPI_15_4 = 2, /**< Variation of the MPI model, reduced number of CNN stages to 4: faster but less accurate.*/
BODY_18 = 3, /**< Experimental. Do not use. */
BODY_19 = 4, /**< Experimental. Do not use. */
BODY_22 = 5, /**< Experimental. Do not use. */
BODY_23 = 5, /**< Experimental. Do not use. */
Size,
};
......
......@@ -39,7 +39,7 @@ namespace op
const std::vector<unsigned int> POSE_COCO_MAP_IDX {31,32, 39,40, 33,34, 35,36, 41,42, 43,44, 19,20, 21,22, 23,24, 25,26, 27,28, 29,30, 47,48, 49,50, 53,54, 51,52, 55,56, 37,38, 45,46};
#define POSE_COCO_PAIRS_RENDER_GPU {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17}
const std::vector<unsigned int> POSE_COCO_PAIRS_RENDER {POSE_COCO_PAIRS_RENDER_GPU};
const std::vector<unsigned int> POSE_COCO_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17, 2,16, 5,17};
const std::vector<unsigned int> POSE_COCO_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0, 0,14, 14,16, 0,15, 15,17, 2,16, 5,17};
#define POSE_COCO_COLORS_RENDER_GPU \
255.f, 0.f, 85.f, \
255.f, 0.f, 0.f, \
......@@ -179,38 +179,40 @@ namespace op
255.f, 0.f, 255.f, \
85.f, 0.f, 255.f
const std::vector<float> POSE_BODY_19_COLORS_RENDER{POSE_BODY_19_COLORS_RENDER_GPU};
// BODY_22
const std::map<unsigned int, std::string> POSE_BODY_22_BODY_PARTS {
{0, "Nose"},
{1, "Neck"},
{2, "RShoulder"},
{3, "RElbow"},
{4, "RWrist"},
{5, "LShoulder"},
{6, "LElbow"},
{7, "LWrist"},
// BODY_23
const std::map<unsigned int, std::string> POSE_BODY_23_BODY_PARTS {
{0, "Neck"},
{1, "RShoulder"},
{2, "RElbow"},
{3, "RWrist"},
{4, "LShoulder"},
{5, "LElbow"},
{6, "LWrist"},
{7, "LowerAbs"},
{8, "RHip"},
{9, "RKnee"},
{10, "RAnkle"},
{11, "LHip"},
{12, "LKnee"},
{13, "LAnkle"},
{14, "REye"},
{15, "LEye"},
{16, "REar"},
{17, "LEar"},
{18, "RTest1"},
{19, "LTest1"},
{20, "RTest2"},
{21, "LTest2"},
{22, "Background"}
{11, "RBigToe"},
{12, "RSmallToe"},
{13, "LHip"},
{14, "LKnee"},
{15, "LAnkle"},
{16, "LBigToe"},
{17, "LSmallToe"},
{18, "Nose"},
{19, "REye"},
{20, "REar"},
{21, "LEye"},
{22, "LEar"},
{23, "Background"}
};
const unsigned int POSE_BODY_22_NUMBER_PARTS = 22u; // Equivalent to size of std::map POSE_BODY_22_BODY_PARTS - 1 (removing background)
const std::vector<unsigned int> POSE_BODY_22_MAP_IDX {35,36, 43,45, 37,38, 39,40, 45,46, 47,48, 23,24, 25,26, 27,28, 29,30, 31,32, 33,34, 51,52};
#define POSE_BODY_22_PAIRS_RENDER_GPU {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12}
const std::vector<unsigned int> POSE_BODY_22_PAIRS_RENDER {POSE_BODY_22_PAIRS_RENDER_GPU};
const std::vector<unsigned int> POSE_BODY_22_PAIRS {1,2, 1,5, 2,3, 3,4, 5,6, 6,7, 1,8, 8,9, 9,10, 1,11, 11,12, 12,13, 1,0};
#define POSE_BODY_22_COLORS_RENDER_GPU \
const unsigned int POSE_BODY_23_NUMBER_PARTS = 22u; // Equivalent to size of std::map POSE_BODY_23_BODY_PARTS - 1 (removing background)
const std::vector<unsigned int> POSE_BODY_23_MAP_IDX {24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71};
#define POSE_BODY_23_PAIRS_RENDER_GPU { 0,1, 0,4, 1,2, 2,3, 4,5, 5,6, 0,7, 7,8, 7,13, 8,9, 9,10,10,11,10,12,13,14,14,15,15,16,15,17, 0,18,18,19,18,21,19,20,21,22}
const std::vector<unsigned int> POSE_BODY_23_PAIRS_RENDER {POSE_BODY_23_PAIRS_RENDER_GPU};
const std::vector<unsigned int> POSE_BODY_23_PAIRS { 0,1, 0,4, 1,2, 2,3, 4,5, 5,6, 0,7, 7,8, 7,13, 8,9, 9,10,10,11,10,12,13,14,14,15,15,16,15,17, 0,18,18,19,18,21,19,20,21,22, 1,20, 4,22};
#define POSE_BODY_23_COLORS_RENDER_GPU \
255.f, 0.f, 85.f, \
255.f, 0.f, 0.f, \
255.f, 85.f, 0.f, \
255.f, 170.f, 0.f, \
......@@ -218,18 +220,18 @@ namespace op
170.f, 255.f, 0.f, \
85.f, 255.f, 0.f, \
0.f, 255.f, 0.f, \
255.f, 0.f, 0.f, \
0.f, 255.f, 85.f, \
0.f, 255.f, 170.f, \
0.f, 255.f, 255.f, \
0.f, 170.f, 255.f, \
0.f, 85.f, 255.f, \
0.f, 0.f, 255.f, \
85.f, 0.f, 255.f, \
255.f, 0.f, 170.f, \
170.f, 0.f, 255.f, \
255.f, 0.f, 255.f, \
255.f, 0.f, 170.f, \
255.f, 0.f, 85.f
const std::vector<float> POSE_BODY_22_COLORS_RENDER{POSE_BODY_22_COLORS_RENDER_GPU};
85.f, 0.f, 255.f
const std::vector<float> POSE_BODY_23_COLORS_RENDER{POSE_BODY_23_COLORS_RENDER_GPU};
// Constant Array Parameters
const std::array<float, (int)PoseModel::Size> POSE_CCN_DECREASE_FACTOR{
......@@ -239,19 +241,19 @@ namespace op
POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE
};
const std::array<unsigned int, (int)PoseModel::Size> POSE_NUMBER_BODY_PARTS{
POSE_COCO_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_BODY_18_NUMBER_PARTS, POSE_BODY_19_NUMBER_PARTS, POSE_BODY_22_NUMBER_PARTS
POSE_COCO_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_BODY_18_NUMBER_PARTS, POSE_BODY_19_NUMBER_PARTS, POSE_BODY_23_NUMBER_PARTS
};
const std::array<std::vector<unsigned int>, (int)PoseModel::Size> POSE_BODY_PART_PAIRS{
POSE_COCO_PAIRS, POSE_MPI_PAIRS, POSE_MPI_PAIRS, POSE_BODY_18_PAIRS, POSE_BODY_19_PAIRS, POSE_BODY_22_PAIRS
POSE_COCO_PAIRS, POSE_MPI_PAIRS, POSE_MPI_PAIRS, POSE_BODY_18_PAIRS, POSE_BODY_19_PAIRS, POSE_BODY_23_PAIRS
};
const std::array<std::vector<unsigned int>, (int)PoseModel::Size> POSE_BODY_PART_PAIRS_RENDER{
POSE_COCO_PAIRS_RENDER, POSE_MPI_PAIRS, POSE_MPI_PAIRS, POSE_BODY_18_PAIRS_RENDER, POSE_BODY_19_PAIRS_RENDER, POSE_BODY_22_PAIRS_RENDER
POSE_COCO_PAIRS_RENDER, POSE_MPI_PAIRS, POSE_MPI_PAIRS, POSE_BODY_18_PAIRS_RENDER, POSE_BODY_19_PAIRS_RENDER, POSE_BODY_23_PAIRS_RENDER
};
const std::array<std::vector<unsigned int>, (int)PoseModel::Size> POSE_MAP_IDX{
POSE_COCO_MAP_IDX, POSE_MPI_MAP_IDX, POSE_MPI_MAP_IDX, POSE_BODY_18_MAP_IDX, POSE_BODY_19_MAP_IDX, POSE_BODY_22_MAP_IDX
POSE_COCO_MAP_IDX, POSE_MPI_MAP_IDX, POSE_MPI_MAP_IDX, POSE_BODY_18_MAP_IDX, POSE_BODY_19_MAP_IDX, POSE_BODY_23_MAP_IDX
};
const std::array<std::vector<float>, (int)PoseModel::Size> POSE_COLORS{
POSE_COCO_COLORS_RENDER,POSE_MPI_COLORS_RENDER, POSE_MPI_COLORS_RENDER, POSE_BODY_18_COLORS_RENDER, POSE_BODY_19_COLORS_RENDER, POSE_BODY_22_COLORS_RENDER
POSE_COCO_COLORS_RENDER,POSE_MPI_COLORS_RENDER, POSE_MPI_COLORS_RENDER, POSE_BODY_18_COLORS_RENDER, POSE_BODY_19_COLORS_RENDER, POSE_BODY_23_COLORS_RENDER
};
const std::array<std::string, (int)PoseModel::Size> POSE_PROTOTXT{
"pose/coco/pose_deploy_linevec.prototxt",
......@@ -259,7 +261,7 @@ namespace op
"pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt",
"pose/body_18/pose_deploy.prototxt",
"pose/body_19/pose_deploy.prototxt",
"pose/body_22/pose_deploy.prototxt"
"pose/body_23/pose_deploy.prototxt"
};
const std::array<std::string, (int)PoseModel::Size> POSE_TRAINED_MODEL{
"pose/coco/pose_iter_440000.caffemodel",
......@@ -267,7 +269,7 @@ namespace op
"pose/mpi/pose_iter_160000.caffemodel",
"pose/body_18/pose_iter_XXXXXX.caffemodel",
"pose/body_19/pose_iter_XXXXXX.caffemodel",
"pose/body_22/pose_iter_40000.caffemodel"
"pose/body_23/pose_iter_42000.caffemodel"
};
// POSE_BODY_PART_MAPPING crashes on Windows at dynamic initialization, to avoid this crash:
// POSE_BODY_PART_MAPPING has been moved to poseParameters.cpp and getPoseBodyPartMapping() wraps it
......
......@@ -41,7 +41,7 @@ namespace op
if (nA == 0) // nB == 0 or not
{
if (poseModel == PoseModel::COCO_18 || poseModel == PoseModel::BODY_18
|| poseModel == PoseModel::BODY_19 || poseModel == PoseModel::BODY_22)
|| poseModel == PoseModel::BODY_19 || poseModel == PoseModel::BODY_23)
{
for (auto i = 1; i <= nB; i++)
{
......@@ -83,7 +83,7 @@ namespace op
else // if (nA != 0 && nB == 0)
{
if (poseModel == PoseModel::COCO_18 || poseModel == PoseModel::BODY_18
|| poseModel == PoseModel::BODY_19 || poseModel == PoseModel::BODY_22)
|| poseModel == PoseModel::BODY_19 || poseModel == PoseModel::BODY_23)
{
for (auto i = 1; i <= nA; i++)
{
......@@ -217,7 +217,8 @@ namespace op
}
// Add ears connections (in case person is looking to opposite direction to camera)
else if (((poseModel == PoseModel::COCO_18 || poseModel == PoseModel::BODY_18) && (pairIndex==17 || pairIndex==18))
|| (poseModel == PoseModel::BODY_19 && (pairIndex==18 || pairIndex==19)))
|| (poseModel == PoseModel::BODY_19 && (pairIndex==18 || pairIndex==19))
|| (poseModel == PoseModel::BODY_23 && (pairIndex==22 || pairIndex==23)))
{
for (const auto& connectionKI : connectionK)
{
......
......@@ -3,7 +3,7 @@
namespace op
{
const std::array<std::map<unsigned int, std::string>, (int)PoseModel::Size> POSE_BODY_PART_MAPPING{
POSE_COCO_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_BODY_18_BODY_PARTS, POSE_BODY_19_BODY_PARTS, POSE_BODY_22_BODY_PARTS
POSE_COCO_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_BODY_18_BODY_PARTS, POSE_BODY_19_BODY_PARTS, POSE_BODY_23_BODY_PARTS
};
unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::vector<std::string>& strings)
......
......@@ -11,12 +11,12 @@ namespace op
__constant__ const unsigned int COCO_PAIRS_GPU[] = POSE_COCO_PAIRS_RENDER_GPU;
__constant__ const unsigned int BODY_18_PAIRS_GPU[] = POSE_BODY_18_PAIRS_RENDER_GPU;
__constant__ const unsigned int BODY_19_PAIRS_GPU[] = POSE_BODY_19_PAIRS_RENDER_GPU;
__constant__ const unsigned int BODY_22_PAIRS_GPU[] = POSE_BODY_22_PAIRS_RENDER_GPU;
__constant__ const unsigned int BODY_23_PAIRS_GPU[] = POSE_BODY_23_PAIRS_RENDER_GPU;
__constant__ const unsigned int MPI_PAIRS_GPU[] = POSE_MPI_PAIRS_RENDER_GPU;
__constant__ const float COCO_COLORS[] = {POSE_COCO_COLORS_RENDER_GPU};
__constant__ const float BODY_18_COLORS[] = {POSE_BODY_18_COLORS_RENDER_GPU};
__constant__ const float BODY_19_COLORS[] = {POSE_BODY_19_COLORS_RENDER_GPU};
__constant__ const float BODY_22_COLORS[] = {POSE_BODY_22_COLORS_RENDER_GPU};
__constant__ const float BODY_23_COLORS[] = {POSE_BODY_23_COLORS_RENDER_GPU};
__constant__ const float MPI_COLORS[] = {POSE_MPI_COLORS_RENDER_GPU};
......@@ -176,7 +176,7 @@ namespace op
radius, stickwidth, threshold, alphaColorToAdd, blendOriginalFrame, (googlyEyes ? 15 : -1), (googlyEyes ? 16 : -1));
}
__global__ void renderPoseBody22(float* targetPtr, const int targetWidth, const int targetHeight, const float* const posePtr,
__global__ void renderPoseBody23(float* targetPtr, const int targetWidth, const int targetHeight, const float* const posePtr,
const int numberPeople, const float threshold, const bool googlyEyes, const bool blendOriginalFrame,
const float alphaColorToAdd)
{
......@@ -190,16 +190,16 @@ namespace op
__shared__ float sharedScaleF[POSE_MAX_PEOPLE];
// Other parameters
const auto numberPartPairs = sizeof(BODY_22_PAIRS_GPU) / (2*sizeof(BODY_22_PAIRS_GPU[0]));
const auto numberColors = sizeof(BODY_22_COLORS) / (3*sizeof(BODY_22_COLORS[0]));
const auto numberPartPairs = sizeof(BODY_23_PAIRS_GPU) / (2*sizeof(BODY_23_PAIRS_GPU[0]));
const auto numberColors = sizeof(BODY_23_COLORS) / (3*sizeof(BODY_23_COLORS[0]));
const auto radius = fastMin(targetWidth, targetHeight) / 100.f;
const auto stickwidth = fastMin(targetWidth, targetHeight) / 120.f;
// Render key points
renderKeypoints(targetPtr, sharedMaxs, sharedMins, sharedScaleF,
globalIdx, x, y, targetWidth, targetHeight, posePtr, BODY_22_PAIRS_GPU, numberPeople,
POSE_BODY_22_NUMBER_PARTS, numberPartPairs, BODY_22_COLORS, numberColors,
radius, stickwidth, threshold, alphaColorToAdd, blendOriginalFrame, (googlyEyes ? 14 : -1), (googlyEyes ? 15 : -1));
globalIdx, x, y, targetWidth, targetHeight, posePtr, BODY_23_PAIRS_GPU, numberPeople,
POSE_BODY_23_NUMBER_PARTS, numberPartPairs, BODY_23_COLORS, numberColors,
radius, stickwidth, threshold, alphaColorToAdd, blendOriginalFrame, (googlyEyes ? 19 : -1), (googlyEyes ? 21 : -1));
}
__global__ void renderPoseMpi29Parts(float* targetPtr, const int targetWidth, const int targetHeight, const float* const posePtr,
......@@ -397,8 +397,8 @@ namespace op
else if (poseModel == PoseModel::BODY_19)
renderPoseBody19<<<threadsPerBlock, numBlocks>>>(framePtr, frameSize.x, frameSize.y, posePtr, numberPeople,
renderThreshold, googlyEyes, blendOriginalFrame, alphaBlending);
else if (poseModel == PoseModel::BODY_22)
renderPoseBody22<<<threadsPerBlock, numBlocks>>>(framePtr, frameSize.x, frameSize.y, posePtr, numberPeople,
else if (poseModel == PoseModel::BODY_23)
renderPoseBody23<<<threadsPerBlock, numBlocks>>>(framePtr, frameSize.x, frameSize.y, posePtr, numberPeople,
renderThreshold, googlyEyes, blendOriginalFrame, alphaBlending);
else if (poseModel == PoseModel::MPI_15 || poseModel == PoseModel::MPI_15_4)
renderPoseMpi29Parts<<<threadsPerBlock, numBlocks>>>(framePtr, frameSize.x, frameSize.y, posePtr,
......
......@@ -23,8 +23,8 @@ namespace op
return PoseModel::BODY_18;
else if (poseModeString == "BODY_19")
return PoseModel::BODY_19;
else if (poseModeString == "BODY_22")
return PoseModel::BODY_22;
else if (poseModeString == "BODY_23")
return PoseModel::BODY_23;
// else
error("String does not correspond to any model (COCO, MPI, MPI_4_layers)",
__LINE__, __FUNCTION__, __FILE__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册