提交 de5e778c 编写于 作者: G Gines Hidalgo

Windows warnings removed

上级 e8a4223d
......@@ -12,9 +12,9 @@ namespace op
public:
explicit KeyPointScaler(const ScaleMode scaleMode);
void scale(Array<float>& arrayToScale, const double scaleInputToOutput, const double scaleNetToOutput, const cv::Size& producerSize) const;
void scale(Array<float>& arrayToScale, const float scaleInputToOutput, const float scaleNetToOutput, const cv::Size& producerSize) const;
void scale(std::vector<Array<float>>& arraysToScale, const double scaleInputToOutput, const double scaleNetToOutput, const cv::Size& producerSize) const;
void scale(std::vector<Array<float>>& arraysToScale, const float scaleInputToOutput, const float scaleNetToOutput, const cv::Size& producerSize) const;
private:
const ScaleMode mScaleMode;
......
......@@ -6,7 +6,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include <caffe/net.hpp>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "net.hpp"
namespace op
......@@ -17,6 +17,8 @@ namespace op
NetCaffe(const std::array<int, 4>& netInputSize4D, const std::string& caffeProto, const std::string& caffeTrainedModel, const int gpuId = 0,
const std::string& lastBlobName = "net_output");
virtual ~NetCaffe();
void initializationOnThread();
// Alternative a) getInputDataCpuPtr or getInputDataGpuPtr + forwardPass
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__CORE__RENDERER_HPP
#include <memory> // std::shared_ptr
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......
......@@ -4,7 +4,7 @@
#include <array>
#include <caffe/blob.hpp>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......
......@@ -5,11 +5,11 @@
namespace op
{
void scaleKeyPoints(Array<float>& keyPoints, const double scale);
void scaleKeyPoints(Array<float>& keyPoints, const float scale);
void scaleKeyPoints(Array<float>& keyPoints, const double scaleX, const double scaleY);
void scaleKeyPoints(Array<float>& keyPoints, const float scaleX, const float scaleY);
void scaleKeyPoints(Array<float>& keyPoints, const double scaleX, const double scaleY, const double offsetX, const double offsetY);
void scaleKeyPoints(Array<float>& keyPoints, const float scaleX, const float scaleY, const float offsetX, const float offsetY);
}
#endif // OPENPOSE__CORE__SCALE_KEY_POINTS_HPP
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "cvMatToOpInput.hpp"
namespace op
......@@ -30,11 +30,11 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/openCv.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "cvMatToOpOutput.hpp"
namespace op
......@@ -30,11 +30,11 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/openCv.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
#ifndef OPENPOSE__CORE__W_KEY_POINT_SCALER_HPP
#define OPENPOSE__CORE__W_KEY_POINT_SCALER_HPP
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "keyPointScaler.hpp"
#include "scaleKeyPoints.hpp"
......@@ -27,10 +27,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......@@ -59,7 +59,7 @@ namespace op
for (auto& tDatum : *tDatums)
{
std::vector<Array<float>> arraysToScale{tDatum.poseKeyPoints, tDatum.handKeyPoints, tDatum.faceKeyPoints};
spKeyPointScaler->scale(arraysToScale, tDatum.scaleInputToOutput, tDatum.scaleNetToOutput, tDatum.cvInputData.size());
spKeyPointScaler->scale(arraysToScale, (float)tDatum.scaleInputToOutput, (float)tDatum.scaleNetToOutput, tDatum.cvInputData.size());
}
// Profiling speed
Profiler::timerEnd(profilerKey);
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "opOutputToCvMat.hpp"
namespace op
......@@ -31,10 +31,10 @@ namespace op
// Implementation
#include <vector>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -6,11 +6,11 @@
#include <memory> // std::shared_ptr
#include <thread>
#include <opencv2/core/core.hpp>
#include "../../core/array.hpp"
#include "../../core/net.hpp"
#include "../../core/nmsCaffe.hpp"
#include "../../core/resizeAndMergeCaffe.hpp"
#include "../../pose/enumClasses.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/net.hpp>
#include <openpose/core/nmsCaffe.hpp>
#include <openpose/core/resizeAndMergeCaffe.hpp>
#include <openpose/pose/enumClasses.hpp>
#include "enumClasses.hpp"
namespace op
......@@ -37,12 +37,12 @@ namespace op
private:
const cv::Size mNetOutputSize;
const cv::Size mOutputSize;
const unsigned char mNeck;
const unsigned char mNose;
const unsigned char mLEar;
const unsigned char mREar;
const unsigned char mLEye;
const unsigned char mREye;
const unsigned int mNeck;
const unsigned int mNose;
const unsigned int mLEar;
const unsigned int mREar;
const unsigned int mLEye;
const unsigned int mREye;
std::array<std::atomic<double>, (int)FaceProperty::Size> mProperties;
std::shared_ptr<Net> spNet;
std::shared_ptr<ResizeAndMergeCaffe<float>> spResizeAndMergeCaffe;
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__FACE__FACE_PARAMETERS_HPP
#include "enumClasses.hpp"
#include "../../pose/poseParameters.hpp"
#include <openpose/pose/poseParameters.hpp>
namespace op
{
......
......@@ -2,9 +2,9 @@
#define OPENPOSE__FACE__FACE_RENDERER_HPP
#include <opencv2/core/core.hpp>
#include "../../core/array.hpp"
#include "../../core/renderer.hpp"
#include "../../thread/worker.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/renderer.hpp>
#include <openpose/thread/worker.hpp>
namespace op
{
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__FACE__W_FACE_EXTRACTOR_HPP
#include <memory> // std::shared_ptr
#include "../../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "faceRenderer.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include "../../utilities/errorAndLog.hpp"
#include "../../utilities/macros.hpp"
#include "../../utilities/pointerContainer.hpp"
#include "../../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
namespace experimental
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__FACE__W_FACE_RENDERER_HPP
#include <memory> // std::shared_ptr
#include "../../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "faceRenderer.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include "../../utilities/errorAndLog.hpp"
#include "../../utilities/macros.hpp"
#include "../../utilities/pointerContainer.hpp"
#include "../../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
namespace experimental
......
......@@ -5,8 +5,8 @@
#define OPENPOSE__EXPERIMENTAL__FILESTREAM__W_POSE_JSON_COCO_SAVER_HPP
#include <memory> // std::shared_ptr
#include "../../filestream/poseJsonCocoSaver.hpp"
#include "../../thread/workerConsumer.hpp"
#include <openpose/filestream/poseJsonCocoSaver.hpp>
#include <openpose/thread/workerConsumer.hpp>
namespace op
{
......@@ -35,10 +35,10 @@ namespace op
// Implementation
#include "../../utilities/errorAndLog.hpp"
#include "../../utilities/macros.hpp"
#include "../../utilities/pointerContainer.hpp"
#include "../../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
namespace experimental
......
......@@ -11,4 +11,3 @@ namespace op
}
#endif // OPENPOSE__HAND__ENUM_CLASSES_HPP
......@@ -6,11 +6,11 @@
#include <memory> // std::shared_ptr
#include <thread>
#include <opencv2/core/core.hpp>
#include "../../core/array.hpp"
#include "../../core/net.hpp"
#include "../../core/nmsCaffe.hpp"
#include "../../core/resizeAndMergeCaffe.hpp"
#include "../../pose/enumClasses.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/net.hpp>
#include <openpose/core/nmsCaffe.hpp>
#include <openpose/core/resizeAndMergeCaffe.hpp>
#include <openpose/pose/enumClasses.hpp>
#include "enumClasses.hpp"
namespace op
......@@ -37,12 +37,12 @@ namespace op
private:
const cv::Size mNetOutputSize;
const cv::Size mOutputSize;
const unsigned char mRWrist;
const unsigned char mRElbow;
const unsigned char mLWrist;
const unsigned char mLElbow;
const unsigned char mNeck;
const unsigned char mHeadNose;
const unsigned int mRWrist;
const unsigned int mRElbow;
const unsigned int mLWrist;
const unsigned int mLElbow;
const unsigned int mNeck;
const unsigned int mHeadNose;
std::array<std::atomic<double>, (int)HandsProperty::Size> mProperties;
std::shared_ptr<Net> spNet;
std::shared_ptr<ResizeAndMergeCaffe<float>> spResizeAndMergeCaffe;
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__HAND__HAND_PARAMETERS_HPP
#include "enumClasses.hpp"
#include "../../pose/poseParameters.hpp"
#include <openpose/pose/poseParameters.hpp>
namespace op
{
......
......@@ -2,9 +2,9 @@
#define OPENPOSE__HAND__HAND_RENDERER_HPP
#include <opencv2/core/core.hpp>
#include "../../core/array.hpp"
#include "../../core/renderer.hpp"
#include "../../thread/worker.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/renderer.hpp>
#include <openpose/thread/worker.hpp>
namespace op
{
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__HAND__W_HAND_EXTRACTOR_HPP
#include <memory> // std::shared_ptr
#include "../../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "handRenderer.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include "../../utilities/errorAndLog.hpp"
#include "../../utilities/macros.hpp"
#include "../../utilities/pointerContainer.hpp"
#include "../../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
namespace experimental
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__HAND__W_HAND_RENDERER_HPP
#include <memory> // std::shared_ptr
#include "../../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "handRenderer.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include "../../utilities/errorAndLog.hpp"
#include "../../utilities/macros.hpp"
#include "../../utilities/pointerContainer.hpp"
#include "../../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
namespace experimental
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__FILESTREAM__DATA_SAVER_HPP
#include <string>
#include "../utilities/string.hpp"
#include <openpose/utilities/string.hpp>
namespace op
{
......
......@@ -5,7 +5,7 @@
#include <vector>
#include <opencv2/core/core.hpp> // cv::Mat, cv::Size
#include <opencv2/highgui/highgui.hpp> // CV_LOAD_IMAGE_ANYDEPTH, CV_IMWRITE_PNG_COMPRESSION
#include "../core/array.hpp"
#include <openpose/core/array.hpp>
#include "enumClasses.hpp"
namespace op
......
......@@ -3,7 +3,7 @@
#include <fstream> // std::ofstream
#include <string>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......
......@@ -2,8 +2,8 @@
#define OPENPOSE__FILESTREAM__POSE_JSON_COCO_SAVER_HPP
#include <string>
#include "../core/array.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/array.hpp>
#include <openpose/utilities/macros.hpp>
#include "jsonOfstream.hpp"
namespace op
......@@ -22,7 +22,7 @@ namespace op
~PoseJsonCocoSaver();
void record(const Array<float>& poseKeyPoints, const int imageId);
void record(const Array<float>& poseKeyPoints, const unsigned long long imageId);
private:
JsonOfstream mJsonOfstream;
......
......@@ -3,7 +3,7 @@
#include <string>
#include <vector>
#include "../core/array.hpp"
#include <openpose/core/array.hpp>
#include "fileSaver.hpp"
namespace op
......
#ifndef OPENPOSE__FILESTREAM__POSE_SAVER_HPP
#define OPENPOSE__FILESTREAM__POSE_SAVER_HPP
#include "../core/array.hpp"
#include <openpose/core/array.hpp>
#include "enumClasses.hpp"
#include "fileSaver.hpp"
......
......@@ -4,7 +4,7 @@
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp> // cv::VideoWriter
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "heatMapSaver.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include <vector>
#include <opencv2/core/core.hpp>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "imageSaver.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include <vector>
#include <opencv2/core/core.hpp>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "poseJsonSaver.hpp"
namespace op
......@@ -30,10 +30,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "enumClasses.hpp"
#include "poseSaver.hpp"
......@@ -31,10 +31,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include <opencv2/core/core.hpp>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "videoSaver.hpp"
namespace op
......@@ -32,10 +32,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -4,8 +4,8 @@
#include <atomic>
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../pose/poseExtractor.hpp"
#include "../pose/poseRenderer.hpp"
#include <openpose/pose/poseExtractor.hpp>
#include <openpose/pose/poseRenderer.hpp>
#include "enumClasses.hpp"
#include "frameDisplayer.hpp"
......
......@@ -3,7 +3,7 @@
#include <queue>
#include <opencv2/core/core.hpp>
#include "../core/array.hpp"
#include <openpose/core/array.hpp>
namespace op
{
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../thread/workerConsumer.hpp"
#include <openpose/thread/workerConsumer.hpp>
#include "enumClasses.hpp"
#include "gui.hpp"
......@@ -31,10 +31,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__GUI__W_ADD_GUI_INFO_HPP
#include "guiInfoAdder.hpp"
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
namespace op
{
......@@ -28,10 +28,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
#ifndef OPENPOSE__POSE__BODY_PARTS_CONNECTOR_HPP
#define OPENPOSE__POSE__BODY_PARTS_CONNECTOR_HPP
#include "../core/array.hpp"
#include <openpose/core/array.hpp>
#include "enumClasses.hpp"
namespace op
......
......@@ -4,8 +4,8 @@
#include <array>
#include <caffe/blob.hpp>
#include "../core/array.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/array.hpp>
#include <openpose/utilities/macros.hpp>
#include "enumClasses.hpp"
namespace op
......
......@@ -5,10 +5,10 @@
#include <atomic>
#include <thread>
#include <opencv2/core/core.hpp>
#include "../core/array.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/enumClasses.hpp>
#include <openpose/utilities/macros.hpp>
#include "poseParameters.hpp"
#include "../core/enumClasses.hpp"
namespace op
{
......@@ -18,6 +18,8 @@ namespace op
PoseExtractor(const cv::Size& netOutputSize, const cv::Size& outputSize, const PoseModel poseModel, const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScaleMode = ScaleMode::ZeroToOne);
virtual ~PoseExtractor();
void initializationOnThread();
virtual void forwardPass(const Array<float>& inputNetData, const cv::Size& inputDataSize) = 0;
......@@ -45,7 +47,7 @@ namespace op
const cv::Size mNetOutputSize;
const cv::Size mOutputSize;
Array<float> mPoseKeyPoints;
double mScaleNetToOutput;
float mScaleNetToOutput;
void checkThread() const;
......
......@@ -5,11 +5,11 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include <caffe/blob.hpp>
#include "../core/array.hpp"
#include "../core/net.hpp"
#include "../core/nmsCaffe.hpp"
#include "../core/resizeAndMergeCaffe.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/net.hpp>
#include <openpose/core/nmsCaffe.hpp>
#include <openpose/core/resizeAndMergeCaffe.hpp>
#include <openpose/utilities/macros.hpp>
#include "bodyPartConnectorCaffe.hpp"
#include "enumClasses.hpp"
#include "poseExtractor.hpp"
......@@ -23,6 +23,8 @@ namespace op
const float scaleGap, const PoseModel poseModel, const std::string& modelFolder, const int gpuId, const std::vector<HeatMapType>& heatMapTypes = {},
const ScaleMode heatMapScaleMode = ScaleMode::ZeroToOne);
virtual ~PoseExtractorCaffe();
void netInitializationOnThread();
void forwardPass(const Array<float>& inputNetData, const cv::Size& inputDataSize);
......
......@@ -10,7 +10,7 @@ namespace op
{
// Model-Dependent Parameters
// #define when needed in CUDA code
const std::map<unsigned char, std::string> POSE_COCO_BODY_PARTS {
const std::map<unsigned int, std::string> POSE_COCO_BODY_PARTS {
{0, "Nose"},
{1, "Neck"},
{2, "RShoulder"},
......@@ -31,12 +31,12 @@ namespace op
{17, "LEar"},
{18, "Background"}
};
const unsigned char POSE_COCO_NUMBER_PARTS = 18; // Equivalent to size of std::map POSE_COCO_BODY_PARTS - 1 (removing background)
const std::vector<unsigned char> 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};
const std::vector<unsigned char> 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 unsigned int POSE_COCO_NUMBER_PARTS = 18u; // Equivalent to size of std::map POSE_COCO_BODY_PARTS - 1 (removing background)
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};
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_PAIRS_TO_RENDER {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::map<unsigned char, std::string> POSE_MPI_BODY_PARTS{
const std::map<unsigned int, std::string> POSE_MPI_BODY_PARTS{
{0, "Head"},
{1, "Neck"},
{2, "RShoulder"},
......@@ -54,20 +54,20 @@ namespace op
{14, "Chest"},
{15, "Background"}
};
const unsigned char POSE_MPI_NUMBER_PARTS = 15; // Equivalent to size of std::map POSE_MPI_NUMBER_PARTS - 1 (removing background)
const std::vector<unsigned char> POSE_MPI_MAP_IDX {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 38, 39, 40, 41, 42, 43, 32, 33, 34, 35, 36, 37};
const std::vector<unsigned char> POSE_MPI_PAIRS {0,1, 1,2, 2,3, 3,4, 1,5, 5,6, 6,7, 1,14, 14,11, 11,12, 12,13, 14,8, 8,9, 9,10};
const unsigned int POSE_MPI_NUMBER_PARTS = 15; // Equivalent to size of std::map POSE_MPI_NUMBER_PARTS - 1 (removing background)
const std::vector<unsigned int> POSE_MPI_MAP_IDX {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 38, 39, 40, 41, 42, 43, 32, 33, 34, 35, 36, 37};
const std::vector<unsigned int> POSE_MPI_PAIRS {0,1, 1,2, 2,3, 3,4, 1,5, 5,6, 6,7, 1,14, 14,11, 11,12, 12,13, 14,8, 8,9, 9,10};
#define POSE_MPI_PAIRS_TO_RENDER {0,1, 2,3, 3,4, 5,6, 6,7, 11,12, 12,13, 8,9, 9,10}
// Constant Global Parameters
const unsigned char POSE_MAX_PEOPLE = 96;
const unsigned int POSE_MAX_PEOPLE = 96u;
// Constant Array Parameters
const std::array<float, (int)PoseModel::Size> POSE_CCN_DECREASE_FACTOR{ 8.f, 8.f, 8.f};
const std::array<unsigned int, (int)PoseModel::Size> POSE_MAX_PEAKS{ POSE_MAX_PEOPLE, POSE_MAX_PEOPLE, POSE_MAX_PEOPLE};
const std::array<unsigned char, (int)PoseModel::Size> POSE_NUMBER_BODY_PARTS{ POSE_COCO_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS};
const std::array<std::vector<unsigned char>, 3> POSE_BODY_PART_PAIRS{ POSE_COCO_PAIRS, POSE_MPI_PAIRS, POSE_MPI_PAIRS};
const std::array<std::vector<unsigned char>, 3> POSE_MAP_IDX{ POSE_COCO_MAP_IDX, POSE_MPI_MAP_IDX, POSE_MPI_MAP_IDX};
const std::array<unsigned int, (int)PoseModel::Size> POSE_NUMBER_BODY_PARTS{ POSE_COCO_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS, POSE_MPI_NUMBER_PARTS};
const std::array<std::vector<unsigned int>, 3> POSE_BODY_PART_PAIRS{ POSE_COCO_PAIRS, POSE_MPI_PAIRS, POSE_MPI_PAIRS};
const std::array<std::vector<unsigned int>, 3> POSE_MAP_IDX{ POSE_COCO_MAP_IDX, POSE_MPI_MAP_IDX, POSE_MPI_MAP_IDX};
const std::array<std::string, (int)PoseModel::Size> POSE_PROTOTXT{ "pose/coco/pose_deploy_linevec.prototxt",
"pose/mpi/pose_deploy_linevec.prototxt",
"pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt"};
......@@ -76,15 +76,15 @@ namespace op
"pose/mpi/pose_iter_160000.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
//const std::array<std::map<unsigned char, std::string>, 3> POSE_BODY_PART_MAPPING{ POSE_COCO_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_MPI_BODY_PARTS};
const std::map<unsigned char, std::string>& getPoseBodyPartMapping(const PoseModel poseModel);
//const std::array<std::map<unsigned int, std::string>, 3> POSE_BODY_PART_MAPPING{ POSE_COCO_BODY_PARTS, POSE_MPI_BODY_PARTS, POSE_MPI_BODY_PARTS};
const std::map<unsigned int, std::string>& getPoseBodyPartMapping(const PoseModel poseModel);
// Default Model Parameters
// They might be modified on running time
const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_NMS_THRESHOLD{ 0.05f, 0.6f, 0.3f};
const std::array<unsigned char, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_INTER_MIN_ABOVE_THRESHOLD{ 9, 8, 8};
const std::array<unsigned int, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_INTER_MIN_ABOVE_THRESHOLD{ 9, 8, 8};
const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_INTER_THRESHOLD{ 0.05f, 0.01f, 0.01f};
const std::array<unsigned char, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_MIN_SUBSET_CNT{ 3, 3, 3};
const std::array<unsigned int, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_MIN_SUBSET_CNT{ 3, 3, 3};
const std::array<float, (int)PoseModel::Size> POSE_DEFAULT_CONNECT_MIN_SUBSET_SCORE{ 0.4f, 0.4f, 0.4f};
// Rendering default parameters
......@@ -92,8 +92,8 @@ namespace op
const auto POSE_DEFAULT_ALPHA_HEATMAP = 0.7f;
// Auxiliary functions
unsigned char poseBodyPartMapStringToKey(const PoseModel poseModel, const std::string& string);
unsigned char poseBodyPartMapStringToKey(const PoseModel poseModel, const std::vector<std::string>& strings);
unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::string& string);
unsigned int poseBodyPartMapStringToKey(const PoseModel poseModel, const std::vector<std::string>& strings);
}
#endif // OPENPOSE__POSE__POSE_PARAMETERS_HPP
......@@ -8,7 +8,7 @@
namespace op
{
void renderPoseGpu(float* framePtr, const PoseModel poseModel, const int numberPeople, const cv::Size& frameSize, const float* const posePtr,
const bool googlyEyes = false, const float blendOriginalFrame = true, const float alphaBlending = POSE_DEFAULT_ALPHA_POSE);
const bool googlyEyes = false, const bool blendOriginalFrame = true, const float alphaBlending = POSE_DEFAULT_ALPHA_POSE);
void renderBodyPartGpu(float* frame, const PoseModel poseModel, const cv::Size& frameSize, const float* const heatmap, const cv::Size& heatmapSize,
const float scaleToKeepRatio, const int part, const float alphaBlending = POSE_DEFAULT_ALPHA_HEATMAP);
void renderBodyPartsGpu(float* frame, const PoseModel poseModel, const cv::Size& frameSize, const float* const heatmap, const cv::Size& heatmapSize,
......
......@@ -3,9 +3,9 @@
#include <memory> // std::shared_ptr
#include <opencv2/core/core.hpp>
#include "../core/array.hpp"
#include "../core/renderer.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/array.hpp>
#include <openpose/core/renderer.hpp>
#include <openpose/utilities/macros.hpp>
#include "poseExtractor.hpp"
#include "poseParameters.hpp"
......@@ -16,7 +16,7 @@ namespace op
public:
explicit PoseRenderer(const cv::Size& heatMapsSize, const cv::Size& outputSize, const PoseModel poseModel, const std::shared_ptr<PoseExtractor>& poseExtractor,
const bool blendOriginalFrame = true, const float alphaPose = POSE_DEFAULT_ALPHA_POSE,
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEATMAP, const int elementToRender = 0);
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEATMAP, const unsigned int elementToRender = 0u);
~PoseRenderer();
......@@ -42,20 +42,20 @@ namespace op
void setShowGooglyEyes(const bool showGooglyEyes);
std::pair<int, std::string> renderPose(Array<float>& outputData, const Array<float>& poseKeyPoints, const double scaleNetToOutput = -1.);
std::pair<int, std::string> renderPose(Array<float>& outputData, const Array<float>& poseKeyPoints, const float scaleNetToOutput = -1.f);
private:
const cv::Size mHeatMapsSize;
const cv::Size mOutputSize;
const PoseModel mPoseModel;
const std::map<unsigned char, std::string> mPartIndexToName;
const std::map<unsigned int, std::string> mPartIndexToName;
const int mNumberElementsToRender;
const std::shared_ptr<PoseExtractor> spPoseExtractor;
float mAlphaPose;
float mAlphaHeatMap;
std::atomic<bool> mBlendOriginalFrame;
std::atomic<bool> mShowGooglyEyes;
std::atomic<int> mElementToRender;
std::atomic<unsigned int> mElementToRender;
// Init with thread
float* pGpuPose; // GPU aux memory
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__POSE__W_POSE_EXTRACTOR_HPP
#include <memory> // std::shared_ptr
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "poseExtractor.hpp"
namespace op
......@@ -29,10 +29,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__POSE__W_POSE_RENDERER_HPP
#include <memory> // std::shared_ptr
#include "../thread/worker.hpp"
#include <openpose/thread/worker.hpp>
#include "poseRenderer.hpp"
namespace op
......@@ -29,10 +29,10 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......@@ -60,7 +60,7 @@ namespace op
const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
// Render people pose
for (auto& tDatum : *tDatums)
tDatum.elementRendered = spPoseRenderer->renderPose(tDatum.outputData, tDatum.poseKeyPoints, tDatum.scaleNetToOutput);
tDatum.elementRendered = spPoseRenderer->renderPose(tDatum.outputData, tDatum.poseKeyPoints, (float)tDatum.scaleNetToOutput);
// Profiling speed
Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
......
......@@ -5,9 +5,9 @@
#include <limits> // std::numeric_limits
#include <memory> // std::shared_ptr
#include <tuple>
#include "../core/datum.hpp"
#include "../producer/producer.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/datum.hpp>
#include <openpose/producer/producer.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
......@@ -55,7 +55,7 @@ namespace op
try
{
if (spProducer->getType() != ProducerType::Webcam)
spProducer->set(CV_CAP_PROP_POS_FRAMES, frameFirst);
spProducer->set(CV_CAP_PROP_POS_FRAMES, (double)frameFirst);
}
catch (const std::exception& e)
{
......
......@@ -5,7 +5,7 @@
#include <chrono>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp> // capProperties of OpenCV
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "enumClasses.hpp"
namespace op
......
......@@ -3,7 +3,7 @@
#include <limits> // std::numeric_limits
#include <memory> // std::shared_ptr
#include "../thread/workerProducer.hpp"
#include <openpose/thread/workerProducer.hpp>
#include "datumProducer.hpp"
namespace op
......@@ -31,10 +31,10 @@ namespace op
// Implementation
#include <vector>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/profiler.hpp"
#include "../core/datum.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/profiler.hpp>
#include <openpose/core/datum.hpp>
namespace op
{
template<typename TDatums, typename TDatumsNoPtr>
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__THREAD__PRIORITY_QUEUE_HPP
#include <queue> // std::priority_queue
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "queueBase.hpp"
namespace op
......@@ -28,8 +28,7 @@ namespace op
// Implementation
#include <type_traits> // std::is_same
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
namespace op
{
template<typename TDatums, typename TQueue>
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__THREAD__QUEUE_HPP
#include <queue> // std::queue
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "queueBase.hpp"
namespace op
......@@ -29,8 +29,8 @@ namespace op
// Implementation
#include <type_traits> // std::is_same
#include <vector>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TQueue>
......
......@@ -4,7 +4,7 @@
#include <queue> // std::queue & std::priority_queue
#include <condition_variable>
#include <mutex>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......@@ -66,7 +66,7 @@ namespace op
virtual bool pop(TDatums& tDatums) = 0;
long long getMaxSize() const;
unsigned long long getMaxSize() const;
private:
const long long mMaxSize;
......@@ -90,10 +90,10 @@ namespace op
// Implementation
#include <memory> // std::shared_ptr
#include <vector>
#include "../core/datum.hpp"
#include "../utilities/errorAndLog.hpp"
#include "../utilities/fastMath.hpp"
#include "../utilities/macros.hpp"
#include <openpose/core/datum.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TQueue>
......@@ -398,7 +398,7 @@ namespace op
catch (const std::exception& e)
{
error(e.what(), __LINE__, __FUNCTION__, __FILE__);
return -1;
return 0;
}
}
......@@ -418,7 +418,7 @@ namespace op
}
template<typename TDatums, typename TQueue>
long long QueueBase<TDatums, TQueue>::getMaxSize() const
unsigned long long QueueBase<TDatums, TQueue>::getMaxSize() const
{
try
{
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__THREAD__SUB_THREAD_HPP
#include <vector>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "worker.hpp"
namespace op
......@@ -21,7 +21,7 @@ namespace op
virtual bool work() = 0;
protected:
inline int getTWorkersSize() const
inline size_t getTWorkersSize() const
{
return mTWorkers.size();
}
......@@ -40,8 +40,8 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TWorker>
......
......@@ -24,8 +24,8 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TWorker>
......
......@@ -29,8 +29,8 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TWorker, typename TQueue>
......
......@@ -30,8 +30,8 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TWorker, typename TQueue>
......
......@@ -29,8 +29,8 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums, typename TWorker, typename TQueue>
......
......@@ -5,7 +5,7 @@
#include <memory> // std::shared_ptr
#include <thread>
#include <vector>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "subThread.hpp"
#include "worker.hpp"
......@@ -63,7 +63,7 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include <openpose/utilities/errorAndLog.hpp>
namespace op
{
template<typename TDatums, typename TWorker>
......
......@@ -6,7 +6,7 @@
#include <set> // std::multiset
#include <tuple>
#include <vector>
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
#include "enumClasses.hpp"
#include "queue.hpp"
#include "thread.hpp"
......@@ -85,8 +85,8 @@ namespace op
// Implementation
#include <utility> // std::pair
#include "../utilities/errorAndLog.hpp"
#include "../utilities/fastMath.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include "subThread.hpp"
#include "subThreadNoQueue.hpp"
#include "subThreadQueueIn.hpp"
......@@ -464,7 +464,7 @@ namespace op
maxQueueId = fastMax(maxQueueId, fastMax(std::get<2>(threadWorkerQueue), std::get<3>(threadWorkerQueue)));
// Check each queue id has at least a worker that uses it as input and another one as output. Special cases:
std::vector<std::pair<bool, bool>> usedQueueIds(maxQueueId + 1, {false, false});
std::vector<std::pair<bool, bool>> usedQueueIds(maxQueueId+1, {false, false});
for (const auto& threadWorkerQueue : mThreadWorkerQueues)
{
usedQueueIds.at(std::get<2>(threadWorkerQueue)).first = true;
......
......@@ -28,9 +28,9 @@ namespace op
// Implementation
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/pointerContainer.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -2,8 +2,8 @@
#define OPENPOSE__THREAD__W_QUEUE_ORDERER_HPP
#include <queue> // std::priority_queue
#include <openpose/utilities/pointerContainer.hpp>
#include "worker.hpp"
#include "../utilities/pointerContainer.hpp"
namespace op
{
......@@ -36,9 +36,9 @@ namespace op
// Implementation
#include <chrono>
#include <thread>
#include "../utilities/errorAndLog.hpp"
#include "../utilities/macros.hpp"
#include "../utilities/profiler.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
{
template<typename TDatums>
......
#ifndef OPENPOSE__THREAD__WORKER_HPP
#define OPENPOSE__THREAD__WORKER_HPP
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
......@@ -48,7 +48,7 @@ namespace op
// Implementation
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -26,7 +26,7 @@ namespace op
// Implementation
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -26,7 +26,7 @@ namespace op
// Implementation
#include "../utilities/macros.hpp"
#include <openpose/utilities/macros.hpp>
namespace op
{
template<typename TDatums>
......
......@@ -18,12 +18,7 @@ namespace op
return (totalRequired + numberCudaThreads - 1) / numberCudaThreads;
}
inline dim3 getNumberCudaBlocks(const cv::Size& frameSize, const dim3 numberCudaThreads = dim3{CUDA_NUM_THREADS, CUDA_NUM_THREADS, 1})
{
return dim3{getNumberCudaBlocks(frameSize.width, numberCudaThreads.x),
getNumberCudaBlocks(frameSize.height, numberCudaThreads.y),
numberCudaThreads.z};
}
dim3 getNumberCudaBlocks(const cv::Size& frameSize, const dim3 numberCudaThreads = dim3{ CUDA_NUM_THREADS, CUDA_NUM_THREADS, 1 });
std::pair<dim3, dim3> getNumberCudaThreadsAndBlocks(const cv::Size& frameSize);
}
......
......@@ -3,7 +3,7 @@
#include <memory> // std::shared_ptr
#include <vector>
#include "../core/datum.hpp"
#include <openpose/core/datum.hpp>
#define DATUM_BASE_NO_PTR std::vector<Datum>
#define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR>
......
#ifndef OPENPOSE__WRAPPER__WRAPPER_HPP
#define OPENPOSE__WRAPPER__WRAPPER_HPP
#include "../thread/headers.hpp"
#include <openpose/thread/headers.hpp>
#include "wrapperStructFace.hpp"
#include "wrapperStructHand.hpp"
#include "wrapperStructInput.hpp"
......@@ -263,14 +263,14 @@ namespace op
// Implementation
#include "../core/headers.hpp"
#include "../experimental/headers.hpp"
#include "../filestream/headers.hpp"
#include "../gui/headers.hpp"
#include "../pose/headers.hpp"
#include "../producer/headers.hpp"
#include "../utilities/errorAndLog.hpp"
#include "../utilities/fileSystem.hpp"
#include <openpose/core/headers.hpp>
#include <openpose/experimental/headers.hpp>
#include <openpose/filestream/headers.hpp>
#include <openpose/gui/headers.hpp>
#include <openpose/pose/headers.hpp>
#include <openpose/producer/headers.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fileSystem.hpp>
namespace op
{
template<typename TDatums, typename TWorker, typename TQueue>
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__WRAPPER__WRAPPER_STRUCT_INPUT_HPP
#include <memory>
#include "../producer/producer.hpp"
#include <openpose/producer/producer.hpp>
namespace op
{
......
......@@ -2,7 +2,7 @@
#define OPENPOSE__WRAPPER__WRAPPER_STRUCT_OUTPUT_HPP
#include <string>
#include "../filestream/enumClasses.hpp"
#include <openpose/filestream/enumClasses.hpp>
namespace op
{
......
......@@ -2,9 +2,9 @@
#define OPENPOSE__WRAPPER__WRAPPER_STRUCT_POSE_HPP
#include <opencv2/core/core.hpp>
#include "../core/enumClasses.hpp"
#include "../pose/enumClasses.hpp"
#include "../pose/poseParameters.hpp"
#include <openpose/core/enumClasses.hpp>
#include <openpose/pose/enumClasses.hpp>
#include <openpose/pose/poseParameters.hpp>
namespace op
{
......
#include <typeinfo> // typeid
#include <numeric> // std::accumulate
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/array.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/array.hpp>
namespace op
{
......@@ -248,7 +248,7 @@ namespace op
{
// OpenCV is efficient on copying (AVX, SSE, etc.)
if (mCvMatData.first)
mCvMatData.second.setTo(value);
mCvMatData.second.setTo((double)value);
else
for (auto i = 0 ; i < mVolume ; i++)
operator[](i) = value;
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/fastMath.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/core/cvMatToOpInput.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/core/cvMatToOpInput.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/core/cvMatToOpOutput.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/core/cvMatToOpOutput.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/datum.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/datum.hpp>
namespace op
{
......
#include "openpose/core/headers.hpp"
#include <openpose/core/headers.hpp>
namespace op
{
......
#include "openpose/core/scaleKeyPoints.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/keyPointScaler.hpp"
#include <openpose/core/scaleKeyPoints.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/keyPointScaler.hpp>
namespace op
{
......@@ -9,7 +9,7 @@ namespace op
{
}
void KeyPointScaler::scale(Array<float>& arrayToScale, const double scaleInputToOutput, const double scaleNetToOutput, const cv::Size& producerSize) const
void KeyPointScaler::scale(Array<float>& arrayToScale, const float scaleInputToOutput, const float scaleNetToOutput, const cv::Size& producerSize) const
{
try
{
......@@ -22,7 +22,7 @@ namespace op
}
}
void KeyPointScaler::scale(std::vector<Array<float>>& arrayToScalesToScale, const double scaleInputToOutput, const double scaleNetToOutput, const cv::Size& producerSize) const
void KeyPointScaler::scale(std::vector<Array<float>>& arrayToScalesToScale, const float scaleInputToOutput, const float scaleNetToOutput, const cv::Size& producerSize) const
{
try
{
......@@ -31,27 +31,27 @@ namespace op
// InputResolution
if (mScaleMode == ScaleMode::InputResolution)
for (auto& arrayToScale : arrayToScalesToScale)
scaleKeyPoints(arrayToScale, 1./scaleInputToOutput);
scaleKeyPoints(arrayToScale, 1.f/scaleInputToOutput);
// NetOutputResolution
else if (mScaleMode == ScaleMode::NetOutputResolution)
for (auto& arrayToScale : arrayToScalesToScale)
scaleKeyPoints(arrayToScale, 1./scaleNetToOutput);
scaleKeyPoints(arrayToScale, 1.f/scaleNetToOutput);
// [0,1]
else if (mScaleMode == ScaleMode::ZeroToOne)
{
const auto scale = 1./scaleInputToOutput;
const auto scaleX = scale / ((double)producerSize.width - 1.);
const auto scaleY = scale / ((double)producerSize.height - 1.);
const auto scale = 1.f/scaleInputToOutput;
const auto scaleX = scale / ((float)producerSize.width - 1.f);
const auto scaleY = scale / ((float)producerSize.height - 1.f);
for (auto& arrayToScale : arrayToScalesToScale)
scaleKeyPoints(arrayToScale, scaleX, scaleY);
}
// [-1,1]
else if (mScaleMode == ScaleMode::PlusMinusOne)
{
const auto scale = 2./scaleInputToOutput;
const auto scaleX = (scale / ((double)producerSize.width - 1.));
const auto scaleY = (scale / ((double)producerSize.height - 1.));
const auto offset = -1.;
const auto scale = 2.f/scaleInputToOutput;
const auto scaleX = (scale / ((float)producerSize.width - 1.f));
const auto scaleY = (scale / ((float)producerSize.height - 1.f));
const auto offset = -1.f;
for (auto& arrayToScale : arrayToScalesToScale)
scaleKeyPoints(arrayToScale, scaleX, scaleY, offset, offset);
}
......
#ifdef USE_CAFFE
#include <numeric> // std::accumulate
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/netCaffe.hpp"
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/netCaffe.hpp>
namespace op
{
......@@ -17,6 +17,10 @@ namespace op
{
}
NetCaffe::~NetCaffe()
{
}
void NetCaffe::initializationOnThread()
{
try
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/macros.hpp"
#include "openpose/core/nmsBase.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/nmsBase.hpp>
namespace op
{
......
#include <thrust/scan.h>
#include <thrust/device_ptr.h>
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/core/nmsBase.hpp"
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/core/nmsBase.hpp>
namespace op
{
......
#ifdef USE_CAFFE
#include "openpose/core/nmsBase.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/macros.hpp"
#include "openpose/core/nmsCaffe.hpp"
#include <openpose/core/nmsBase.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/nmsCaffe.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/core/opOutputToCvMat.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/core/opOutputToCvMat.hpp>
namespace op
{
......
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/renderer.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/renderer.hpp>
namespace op
{
......
// #include <opencv2/imgproc/imgproc.hpp>
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/macros.hpp"
#include "openpose/core/resizeAndMergeBase.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/resizeAndMergeBase.hpp>
namespace op
{
......
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/cuda.hu"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/resizeAndMergeBase.hpp"
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/cuda.hu>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/resizeAndMergeBase.hpp>
namespace op
{
......
#ifdef USE_CAFFE
#include "openpose/core/resizeAndMergeBase.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/fastMath.hpp"
#include "openpose/utilities/macros.hpp"
#include "openpose/core/resizeAndMergeCaffe.hpp"
#include <openpose/core/resizeAndMergeBase.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/resizeAndMergeCaffe.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/core/scaleKeyPoints.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/core/scaleKeyPoints.hpp>
namespace op
{
const std::string errorMessage = "This function is only for array of dimension: [sizeA x sizeB x 3].";
void scaleKeyPoints(Array<float>& keyPoints, const double scale)
void scaleKeyPoints(Array<float>& keyPoints, const float scale)
{
try
{
......@@ -17,7 +17,7 @@ namespace op
}
}
void scaleKeyPoints(Array<float>& keyPoints, const double scaleX, const double scaleY)
void scaleKeyPoints(Array<float>& keyPoints, const float scaleX, const float scaleY)
{
try
{
......@@ -48,7 +48,7 @@ namespace op
}
}
void scaleKeyPoints(Array<float>& keyPoints, const double scaleX, const double scaleY, const double offsetX, const double offsetY)
void scaleKeyPoints(Array<float>& keyPoints, const float scaleX, const float scaleY, const float offsetX, const float offsetY)
{
try
{
......
#include "openpose/experimental/face/headers.hpp"
#include <openpose/experimental/face/headers.hpp>
namespace op
{
......
#include <opencv2/opencv.hpp> // CV_WARP_INVERSE_MAP, CV_INTER_LINEAR
#include "openpose/core/netCaffe.hpp"
#include "openpose/experimental/face/faceParameters.hpp"
#include "openpose/pose/poseParameters.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/fastMath.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/experimental/face/faceExtractor.hpp"
#include "openpose/experimental/face/faceRenderGpu.hpp" // For commented debugging section
#include <openpose/core/netCaffe.hpp>
#include <openpose/experimental/face/faceParameters.hpp>
#include <openpose/pose/poseParameters.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/experimental/face/faceExtractor.hpp>
#include <openpose/experimental/face/faceRenderGpu.hpp> // For commented debugging section
namespace op
{
......
#include "openpose/experimental/face/faceParameters.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/cuda.hu"
#include "openpose/utilities/render.hu"
#include "openpose/experimental/face/faceRenderGpu.hpp"
#include <openpose/experimental/face/faceParameters.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/cuda.hu>
#include <openpose/utilities/render.hu>
#include <openpose/experimental/face/faceRenderGpu.hpp>
namespace op
{
......
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "openpose/experimental/face/faceParameters.hpp"
#include "openpose/experimental/face/faceRenderGpu.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/experimental/face/faceRenderer.hpp"
#include <openpose/experimental/face/faceParameters.hpp>
#include <openpose/experimental/face/faceRenderGpu.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/experimental/face/faceRenderer.hpp>
namespace op
{
......
#include "openpose/experimental/filestream/headers.hpp"
#include <openpose/experimental/filestream/headers.hpp>
namespace op
{
......
#include "openpose/experimental/hand/headers.hpp"
#include <openpose/experimental/hand/headers.hpp>
namespace op
{
......
#include <opencv2/opencv.hpp> // CV_WARP_INVERSE_MAP, CV_INTER_LINEAR
#include "openpose/core/netCaffe.hpp"
#include "openpose/experimental/hand/handParameters.hpp"
#include "openpose/pose/poseParameters.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/fastMath.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/experimental/hand/handExtractor.hpp"
// #include "openpose/experimental/hand/handRenderGpu.hpp" // For commented debugging section
#include <openpose/core/netCaffe.hpp>
#include <openpose/experimental/hand/handParameters.hpp>
#include <openpose/pose/poseParameters.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fastMath.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/experimental/hand/handExtractor.hpp>
// #include <openpose/experimental/hand/handRenderGpu.hpp> // For commented debugging section
namespace op
{
......
#include "openpose/experimental/hand/handParameters.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/cuda.hu"
#include "openpose/utilities/render.hu"
#include "openpose/experimental/hand/handRenderGpu.hpp"
#include <openpose/experimental/hand/handParameters.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/cuda.hu>
#include <openpose/utilities/render.hu>
#include <openpose/experimental/hand/handRenderGpu.hpp>
namespace op
{
......
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "openpose/experimental/hand/handParameters.hpp"
#include "openpose/experimental/hand/handRenderGpu.hpp"
#include "openpose/utilities/cuda.hpp"
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/experimental/hand/handRenderer.hpp"
#include <openpose/experimental/hand/handParameters.hpp>
#include <openpose/experimental/hand/handRenderGpu.hpp>
#include <openpose/utilities/cuda.hpp>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/experimental/hand/handRenderer.hpp>
namespace op
{
......
#include "openpose/filestream/headers.hpp"
#include <openpose/filestream/headers.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/fileSystem.hpp"
#include "openpose/filestream/fileSaver.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/fileSystem.hpp>
#include <openpose/filestream/fileSaver.hpp>
namespace op
{
......
#include <opencv2/highgui/highgui.hpp> // cv::imread
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/filestream/jsonOfstream.hpp"
#include "openpose/filestream/fileStream.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/filestream/jsonOfstream.hpp>
#include <openpose/filestream/fileStream.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/utilities/openCv.hpp"
#include "openpose/filestream/fileStream.hpp"
#include "openpose/filestream/heatMapSaver.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/filestream/fileStream.hpp>
#include <openpose/filestream/heatMapSaver.hpp>
namespace op
{
......
#include "openpose/utilities/errorAndLog.hpp"
#include "openpose/filestream/fileStream.hpp"
#include "openpose/filestream/imageSaver.hpp"
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/filestream/fileStream.hpp>
#include <openpose/filestream/imageSaver.hpp>
namespace op
{
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册