Skip to content

Commit

Permalink
Version 1.0.1: Windows DLL library
Browse files Browse the repository at this point in the history
  • Loading branch information
Gines committed Jul 11, 2017
1 parent c047d13 commit 39a0d76
Show file tree
Hide file tree
Showing 135 changed files with 377 additions and 289 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LIB_BUILD_DIR := $(BUILD_DIR)/lib
STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
DYNAMIC_VERSION_MAJOR := 1
DYNAMIC_VERSION_MINOR := 0
DYNAMIC_VERSION_REVISION := 0
DYNAMIC_VERSION_REVISION := 1
DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
#DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
Expand Down
11 changes: 10 additions & 1 deletion doc/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,14 @@ OpenPose Library - Release Notes



## Current version (future OpenPose 1.0.1)
## OpenPose 1.0.1
1. Main improvements:
1. Windows library turned into DLL dynamic library (i.e. portable).
2. Improved documentation.
2. Functions or parameters renamed:
1. `openpose/utilities/macros.hpp` moved to `openpose/utilities/macros.hpp`.



## Current version (future OpenPose 1.0.2)
1. No changes yet.
9 changes: 9 additions & 0 deletions include/openpose/core/common.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef OPENPOSE_CORE_COMMON_HPP
#define OPENPOSE_CORE_COMMON_HPP

#include "rectangle.hpp"
#include "array.hpp"
#include "macros.hpp"
#include "point.hpp"

#endif // OPENPOSE_CORE_COMMON_HPP
5 changes: 2 additions & 3 deletions include/openpose/core/cvMatToOpInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
#include <utility> // std::pair
#include <vector>
#include <opencv2/core/core.hpp> // cv::Mat
#include "array.hpp"
#include "point.hpp"
#include "common.hpp"

namespace op
{
class CvMatToOpInput
class OP_API CvMatToOpInput
{
public:
CvMatToOpInput(const Point<int>& netInputResolution, const int scaleNumber = 1, const float scaleGap = 0.25);
Expand Down
5 changes: 2 additions & 3 deletions include/openpose/core/cvMatToOpOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

#include <vector>
#include <opencv2/core/core.hpp> // cv::Mat
#include "array.hpp"
#include "point.hpp"
#include "common.hpp"

namespace op
{
class CvMatToOpOutput
class OP_API CvMatToOpOutput
{
public:
CvMatToOpOutput(const Point<int>& outputResolution, const bool generateOutput = true);
Expand Down
6 changes: 2 additions & 4 deletions include/openpose/core/datum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#include <memory> // std::shared_ptr
#include <string>
#include <opencv2/core/core.hpp> // cv::Mat
#include "array.hpp"
#include "point.hpp"
#include "rectangle.hpp"
#include "common.hpp"

namespace op
{
Expand All @@ -16,7 +14,7 @@ namespace op
* Datum is one the main OpenPose classes/structs. The workers and threads share by default a std::shared_ptr<std::vector<Datum>>. It contains
* all the parameters that the different workers and threads need to exchange.
*/
struct Datum
struct OP_API Datum
{
// -------------------------------------------------- ID parameters -------------------------------------------------- //
unsigned long long id; /**< Datum ID. Internally used to sort the Datums if multi-threading is used. */
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

// core module
#include "array.hpp"
#include "common.hpp"
#include "cvMatToOpInput.hpp"
#include "cvMatToOpOutput.hpp"
#include "datum.hpp"
#include "enumClasses.hpp"
#include "keypointScaler.hpp"
#include "macros.hpp"
#include "net.hpp"
#include "netCaffe.hpp"
#include "nmsBase.hpp"
Expand Down
5 changes: 2 additions & 3 deletions include/openpose/core/keypointScaler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
#define OPENPOSE_CORE_KEYPOINT_SCALER_HPP

#include <vector>
#include "array.hpp"
#include "point.hpp"
#include "common.hpp"
#include "enumClasses.hpp"

namespace op
{
class KeypointScaler
class OP_API KeypointScaler
{
public:
explicit KeypointScaler(const ScaleMode scaleMode);
Expand Down
52 changes: 52 additions & 0 deletions include/openpose/core/macros.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#ifndef OPENPOSE_UTILITIES_MACROS_HPP
#define OPENPOSE_UTILITIES_MACROS_HPP

#ifndef _WIN32
#define OP_API
#elif defined OP_EXPORTS
#define OP_API __declspec(dllexport)
#else
#define OP_API __declspec(dllimport)
#endif

#define DATUM_BASE_NO_PTR std::vector<Datum>
#define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR>
#define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName<DATUM_BASE>
#define COMPILE_TEMPLATE_DATUM(templateName) extern DEFINE_TEMPLATE_DATUM(templateName)

#define UNUSED(unusedVariable) (void)(unusedVariable)

#define DELETE_COPY(className) \
className(const className&) = delete; \
className& operator=(const className&) = delete

#define COMPILE_TEMPLATE_BASIC_TYPES_CLASS(className) COMPILE_TEMPLATE_BASIC_TYPES(className, class)

#define COMPILE_TEMPLATE_BASIC_TYPES_STRUCT(className) COMPILE_TEMPLATE_BASIC_TYPES(className, struct)

#define COMPILE_TEMPLATE_BASIC_TYPES(className, classType) \
template classType OP_API className<char>; \
template classType OP_API className<signed char>; \
template classType OP_API className<short>; \
template classType OP_API className<int>; \
template classType OP_API className<long>; \
template classType OP_API className<long long>; \
template classType OP_API className<unsigned char>; \
template classType OP_API className<unsigned short>; \
template classType OP_API className<unsigned int>; \
template classType OP_API className<unsigned long>; \
template classType OP_API className<unsigned long long>; \
template classType OP_API className<float>; \
template classType OP_API className<double>; \
template classType OP_API className<long double>

// Includes at the end, since this macros class does not need them, but the files that call this
// file. However, keeping the files at the beginning might create a circular include linking problem.
#include <memory> // std::shared_ptr
#include <vector>
#include <openpose/core/datum.hpp>
#include <openpose/core/point.hpp>
#include <openpose/core/rectangle.hpp>
#include <openpose/core/macros.hpp>

#endif // OPENPOSE_UTILITIES_MACROS_HPP
5 changes: 3 additions & 2 deletions include/openpose/core/maximumBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#define OPENPOSE_CORE_MAXIMUM_BASE_HPP

#include <array>
#include "common.hpp"

namespace op
{
template <typename T>
void maximumCpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
OP_API void maximumCpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);

template <typename T>
void maximumGpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
OP_API void maximumGpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
}

#endif // OPENPOSE_CORE_MAXIMUM_BASE_HPP
5 changes: 3 additions & 2 deletions include/openpose/core/maximumCaffe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#define OPENPOSE_CORE_MAXIMUM_CAFFE_HPP

#include <array>
#include "caffe/blob.hpp"
#include <caffe/blob.hpp>
#include "common.hpp"

namespace op
{
// It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep the compatibility with any generic Caffe version,
// we keep this 'layer' inside our library rather than in the Caffe code.
template <typename T>
class MaximumCaffe
class OP_API MaximumCaffe
{
public:
explicit MaximumCaffe();
Expand Down
4 changes: 3 additions & 1 deletion include/openpose/core/net.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#ifndef OPENPOSE_CORE_NET_HPP
#define OPENPOSE_CORE_NET_HPP

#include "common.hpp"

namespace op
{
class Net
class OP_API Net
{
public:
virtual void initializationOnThread() = 0;
Expand Down
4 changes: 2 additions & 2 deletions include/openpose/core/netCaffe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include <memory> // std::shared_ptr
#include <string>
#include <caffe/net.hpp>
#include <openpose/utilities/macros.hpp>
#include "common.hpp"
#include "net.hpp"

namespace op
{
class NetCaffe : public Net
class OP_API NetCaffe : public Net
{
public:
NetCaffe(const std::array<int, 4>& netInputSize4D, const std::string& caffeProto, const std::string& caffeTrainedModel, const int gpuId = 0,
Expand Down
5 changes: 3 additions & 2 deletions include/openpose/core/nmsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#define OPENPOSE_CORE_NMS_BASE_HPP

#include <array>
#include "common.hpp"

namespace op
{
template <typename T>
void nmsCpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
OP_API void nmsCpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);

template <typename T>
void nmsGpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
OP_API void nmsGpu(T* targetPtr, int* kernelPtr, const T* const sourcePtr, const T threshold, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize);
}

#endif // OPENPOSE_CORE_NMS_BASE_HPP
5 changes: 3 additions & 2 deletions include/openpose/core/nmsCaffe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#define OPENPOSE_CORE_NMS_CAFFE_HPP

#include <array>
#include "caffe/blob.hpp"
#include <caffe/blob.hpp>
#include "common.hpp"

namespace op
{
// It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep the compatibility with any generic Caffe version,
// we keep this 'layer' inside our library rather than in the Caffe code.
template <typename T>
class NmsCaffe
class OP_API NmsCaffe
{
public:
explicit NmsCaffe();
Expand Down
5 changes: 2 additions & 3 deletions include/openpose/core/opOutputToCvMat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
#define OPENPOSE_CORE_OP_OUTPUT_TO_CV_MAT_HPP

#include <opencv2/core/core.hpp> // cv::Mat
#include "array.hpp"
#include "point.hpp"
#include "common.hpp"

namespace op
{
class OpOutputToCvMat
class OP_API OpOutputToCvMat
{
public:
explicit OpOutputToCvMat(const Point<int>& outputResolution);
Expand Down
4 changes: 2 additions & 2 deletions include/openpose/core/renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <atomic>
#include <tuple>
#include <memory> // std::shared_ptr
#include <openpose/utilities/macros.hpp>
#include "common.hpp"

namespace op
{
class Renderer
class OP_API Renderer
{
public:
explicit Renderer(const unsigned long long volume, const float alphaKeypoint, const float alphaHeatMap,
Expand Down
9 changes: 5 additions & 4 deletions include/openpose/core/resizeAndMergeBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

#include <array>
#include <vector>
#include "common.hpp"

namespace op
{
template <typename T>
void resizeAndMergeCpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize,
const std::vector<T>& scaleRatios = {1});
OP_API void resizeAndMergeCpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize,
const std::vector<T>& scaleRatios = {1});

template <typename T>
void resizeAndMergeGpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize,
const std::vector<T>& scaleRatios = {1});
OP_API void resizeAndMergeGpu(T* targetPtr, const T* const sourcePtr, const std::array<int, 4>& targetSize, const std::array<int, 4>& sourceSize,
const std::vector<T>& scaleRatios = {1});
}

#endif // OPENPOSE_CORE_RESIZE_AND_MERGE_BASE_HPP
4 changes: 2 additions & 2 deletions include/openpose/core/resizeAndMergeCaffe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#include <array>
#include <vector>
#include <caffe/blob.hpp>
#include <openpose/utilities/macros.hpp>
#include "common.hpp"

namespace op
{
// It mostly follows the Caffe::layer implementation, so Caffe users can easily use it. However, in order to keep the
// compatibility with any generic Caffe version,
// we keep this 'layer' inside our library rather than in the Caffe code.
template <typename T>
class ResizeAndMergeCaffe
class OP_API ResizeAndMergeCaffe
{
public:
explicit ResizeAndMergeCaffe();
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/wCvMatToOpInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace op

// Implementation
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/macros.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/wCvMatToOpOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace op

// Implementation
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/macros.hpp>
#include <openpose/utilities/openCv.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/wKeypointScaler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace op

// Implementation
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/wOpOutputToCvMat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace op
// Implementation
#include <vector>
#include <openpose/utilities/errorAndLog.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/macros.hpp>
#include <openpose/utilities/pointerContainer.hpp>
#include <openpose/utilities/profiler.hpp>
namespace op
Expand Down
4 changes: 2 additions & 2 deletions include/openpose/face/faceDetector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include <openpose/core/array.hpp>
#include <openpose/core/rectangle.hpp>
#include <openpose/pose/enumClasses.hpp>
#include <openpose/utilities/macros.hpp>
#include <openpose/core/macros.hpp>

namespace op
{
class FaceDetector
class OP_API FaceDetector
{
public:
explicit FaceDetector(const PoseModel poseModel);
Expand Down
3 changes: 2 additions & 1 deletion include/openpose/face/faceExtractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
#include <openpose/core/net.hpp>
#include <openpose/core/rectangle.hpp>
#include <openpose/core/resizeAndMergeCaffe.hpp>
#include <openpose/core/macros.hpp>

namespace op
{
class FaceExtractor
class OP_API FaceExtractor
{
public:
explicit FaceExtractor(const Point<int>& netInputSize, const Point<int>& netOutputSize, const std::string& modelFolder, const int gpuId);
Expand Down
Loading

0 comments on commit 39a0d76

Please sign in to comment.