Skip to content

Commit

Permalink
Virtual destructors for all classes
Browse files Browse the repository at this point in the history
  • Loading branch information
gineshidalgo99 committed Oct 4, 2018
1 parent 2cb1697 commit e59215a
Show file tree
Hide file tree
Showing 156 changed files with 717 additions and 172 deletions.
6 changes: 6 additions & 0 deletions doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ OpenPose - Frequently Asked Question (FAQ)
7. [Free Invalid Pointer Error](#free-invalid-pointer-error)
8. [Source Directory does not Contain CMakeLists.txt (Windows)](#source-directory-does-not-contain-cmakelists.txt-windows)
9. [How Should I Link my IP Camera?](#how-should-i-link-my-ip-camera)
10. [Difference between BODY_25 vs. COCO vs. MPI](#difference-between-body_25-vs.-coco-vs.-mpi)



Expand Down Expand Up @@ -89,3 +90,8 @@ Note: OpenPose library is not an executable, but a library. So instead clicking
**Q: How Should I Link my IP Camera with http protocol?.**

**A**: Usually with `http://CamIP:PORT_NO./video?x.mjpeg`.



### Difference between BODY_25 vs. COCO vs. MPI
COCO model will eventually be removed. BODY_25 model is faster, more accurate, and it includes foot keypoints. However, COCO requires less memory on GPU (being able to fit into 2GB GPUs with the default settings) and it runs faster on CPU-only mode. MPI model is only meant for people requiring the MPI-keypoint structure. It is also slower than BODY_25 and far less accurate.
11 changes: 7 additions & 4 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This installation section is only intended if you plan to modify the OpenPose co
- NVIDIA graphics card with at least 1.6 GB available (the `nvidia-smi` command checks the available GPU memory in Ubuntu).
- At least 2.5 GB of free RAM memory for BODY_25 model or 2 GB for COCO model (assuming cuDNN installed).
- Highly recommended: cuDNN.
- AMD GPU version:
- AMD GPU version:
- Vega series graphics card
- At least 2 GB of free RAM memory.
- CPU version:
Expand Down Expand Up @@ -122,14 +122,15 @@ Any problem installing OpenPose? Check [doc/faq.md](./faq.md) and/or post a GitH
- VS 2015 Enterprise Update 1 will give some compiler errors.
- VS 2015 Community has not been tested.
4. Nvidia GPU version prerequisites:
1. [**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive):
1. **Note: OpenPose has been tested extensively with CUDA 8.0 and cuDNN 5.1**. We highly recommend using those versions to minimize potential installation issues. Other versions should also work, but we do not provide support about any CUDA/cuDNN installation/compilation issue, as well as problems relate dto their integration into OpenPose.
2. [**CUDA 8**](https://developer.nvidia.com/cuda-80-ga2-download-archive):
- Ubuntu: Run `sudo ubuntu/install_cuda.sh` or alternatively download and install it from their website.
- Windows: 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.
- **Important installation tips**:
- New Nvidia model GPUs (e.g., Nvidia V, GTX 2080, any Nvidia with Volta or Turing architecture, etc.) require at least CUDA 9.
- (Windows issue, reported Sep 2018): If your computer hangs when installing CUDA drivers, try installing first the [Nvidia drivers](http://www.nvidia.com/Download/index.aspx), and then installing CUDA without the Graphics Driver flag.
- (Windows): If CMake returns and error message similar to `CUDA_TOOLKIT_ROOT_DIR not found or specified` or any other CUDA component missing, then: 1) Re-install Visual Studio 2015; 2) Reboot your PC; 3) Re-install CUDA.
2. [**cuDNN 5.1**](https://developer.nvidia.com/rdp/cudnn-archive):
3. [**cuDNN 5.1**](https://developer.nvidia.com/rdp/cudnn-archive):
- Ubuntu: Run `sudo ubuntu/install_cudnn.sh` or alternatively download and install it from their website.
- Windows (and Ubuntu if manual installation): In order to manually install it, just unzip it and copy (merge) the contents on the CUDA folder, usually `/usr/local/cuda/` in Ubuntu and `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0` in Windows.
5. AMD GPU version prerequisites:
Expand Down Expand Up @@ -273,6 +274,8 @@ OpenPose displays the FPS in the basic GUI. However, more complex speed metrics
#### COCO and MPI Models
By default, the body COCO and MPI models are not downloaded. You can download them by turning on the `DOWNLOAD_BODY_COCO_MODEL` or `DOWNLOAD_BODY_MPI_MODEL` flags. It's slightly faster but less accurate and has less keypoints than the COCO body model.

Note: Check the differences between these models in [doc/faq.md#difference-between-body_25-vs.-coco-vs.-mpi](./faq.md#difference-between-body_25-vs.-coco-vs.-mpi).



#### Python API
Expand All @@ -295,7 +298,7 @@ export MKL_NUM_THREADS="8"
export OMP_NUM_THREADS="8"
```

Do note that increasing the number of threads results in more memory use. You can check the [OpenPose benchmark](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/faq.md#speed-up-and-benchmark) for more information about speed and memory requirements in several CPUs and GPUs.
Do note that increasing the number of threads results in more memory use. You can check the [doc/faq.md#speed-up-memory-reduction-and-benchmark](./faq.md#speed-up-memory-reduction-and-benchmark) for more information about speed and memory requirements in several CPUs and GPUs.



Expand Down
4 changes: 3 additions & 1 deletion doc/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ OpenPose Library - Release Notes
17. Deprecated flag `--write_keypoint_json` removed (`--write_json` is the equivalent since version 1.2.1).
18. Speed up of cvMatToOpOutput and opOutputToCvMat: op::Datum::outputData is now H x W x C instead of C x H x W, making it much faster to be copied to/from op::Datum::cvOutputData.
19. Much faster GUI display by adding the `WITH_OPENCV_WITH_OPENGL` flag to tell whether to use OpenGL support for OpenCV.
20. Turned security check error into warning when using dynamic `net_resolution` for `image_dir` in CPU/OpenCL versions.
20. Turned sanity check error into warning when using dynamic `net_resolution` for `image_dir` in CPU/OpenCL versions.
21. Minimized CPU usage when queues are empty or full, in order to prevent problems such as general computer slow down, overheating, or excesive power usage.
2. Functions or parameters renamed:
1. Removed scale parameter from hand and face rectangle extractor (causing wrong results if custom `--output_resolution`).
Expand Down Expand Up @@ -271,6 +271,8 @@ OpenPose Library - Release Notes
2. `tutorial_wrapper` renamed as `tutorial_api_cpp` as well as new examples were added.
2. `tutorial_python` renamed as `tutorial_api_python` as well as new examples were added.
3. `tutorial_pose` and `tutorial_thread` renamed as `tutorial_developer`, not meant to be used by users, but rather for OpenPose developers.
7. Added a virtual destructor to almost all clases, so they can be inherited. Exceptions (for performance reasons): Array, Point, Rectangle, CvMatToOpOutput, OpOutputToCvMat.
8. Auxiliary classes in errorAndLog turned into namespaces (Profiler must be kept as class to allow static parameters).
2. Functions or parameters renamed:
1. By default, python example `tutorial_developer/python_2_pose_from_heatmaps.py` was using 2 scales starting at -1x736, changed to 1 scale at -1x368.
2. WrapperStructPose default parameters changed to match those of the OpenPose demo binary.
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/wrapperHandFromJsonTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace op
{
try
{
// Security checks
// Sanity checks
if (spWCvMatToOpInput == nullptr)
error("Configure the WrapperHandFromJsonTest class before calling `start()`.",
__LINE__, __FUNCTION__, __FILE__);
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/3d/cameraParameterReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace op
public:
explicit CameraParameterReader();

virtual ~CameraParameterReader();

// cameraExtrinsics is optional
explicit CameraParameterReader(const std::string& serialNumber,
const cv::Mat& cameraIntrinsics,
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/3d/jointAngleEstimation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace op

JointAngleEstimation(const bool returnJacobian);

virtual ~JointAngleEstimation();

void initializationOnThread();

void adamFastFit(Eigen::Matrix<double, 62, 3, Eigen::RowMajor>& adamPose,
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/3d/poseTriangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace op
public:
PoseTriangulation(const int minViews3d);

virtual ~PoseTriangulation();

void initializationOnThread();

Array<float> reconstructArray(const std::vector<Array<float>>& keypointsVector,
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/3d/wJointAngleEstimation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace op
public:
explicit WJointAngleEstimation(const std::shared_ptr<JointAngleEstimation>& jointAngleEstimation);

virtual ~WJointAngleEstimation();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -39,6 +41,11 @@ namespace op
{
}

template<typename TDatums>
WJointAngleEstimation<TDatums>::~WJointAngleEstimation()
{
}

template<typename TDatums>
void WJointAngleEstimation<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/3d/wPoseTriangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WPoseTriangulation(const std::shared_ptr<PoseTriangulation>& poseTriangulation);

virtual ~WPoseTriangulation();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -38,6 +40,11 @@ namespace op
{
}

template<typename TDatums>
WPoseTriangulation<TDatums>::~WPoseTriangulation()
{
}

template<typename TDatums>
void WPoseTriangulation<TDatums>::initializationOnThread()
{
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/cvMatToOpInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace op
public:
CvMatToOpInput(const PoseModel poseModel = PoseModel::BODY_25);

virtual ~CvMatToOpInput();

std::vector<Array<float>> createArray(const cv::Mat& cvInputData,
const std::vector<double>& scaleInputToNetInputs,
const std::vector<Point<int>>& netInputSizes) const;
Expand Down
2 changes: 1 addition & 1 deletion include/openpose/core/gpuRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace op
const float alphaHeatMap, const bool blendOriginalFrame = true,
const unsigned int elementToRender = 0u, const unsigned int numberElementsToRender = 0u);

~GpuRenderer();
virtual ~GpuRenderer();

std::tuple<std::shared_ptr<float*>, std::shared_ptr<bool>, std::shared_ptr<std::atomic<unsigned int>>,
std::shared_ptr<std::atomic<unsigned long long>>, std::shared_ptr<const unsigned int>>
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/keepTopNPeople.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace op
public:
explicit KeepTopNPeople(const int numberPeopleMax);

virtual ~KeepTopNPeople();

Array<float> keepTopPeople(const Array<float>& peopleArrays, const Array<float>& poseScores) const;

private:
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/keypointScaler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace op
public:
explicit KeypointScaler(const ScaleMode scaleMode);

virtual ~KeypointScaler();

void scale(Array<float>& arrayToScale, const double scaleInputToOutput, const double scaleNetToOutput,
const Point<int>& producerSize) const;

Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace op
const bool blendOriginalFrame = true, const unsigned int elementToRender = 0u,
const unsigned int numberElementsToRender = 0u);

virtual ~Renderer();

void increaseElementToRender(const int increment);

void setElementToRender(const int elementToRender);
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/core/scaleAndSizeExtractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace op
ScaleAndSizeExtractor(const Point<int>& netInputResolution, const Point<int>& outputResolution,
const int scaleNumber = 1, const double scaleGap = 0.25);

virtual ~ScaleAndSizeExtractor();

std::tuple<std::vector<double>, std::vector<Point<int>>, double, Point<int>> extract(
const Point<int>& inputResolution) const;

Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wCvMatToOpInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WCvMatToOpInput(const std::shared_ptr<CvMatToOpInput>& cvMatToOpInput);

virtual ~WCvMatToOpInput();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -38,6 +40,11 @@ namespace op
{
}

template<typename TDatums>
WCvMatToOpInput<TDatums>::~WCvMatToOpInput()
{
}

template<typename TDatums>
void WCvMatToOpInput<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wCvMatToOpOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WCvMatToOpOutput(const std::shared_ptr<CvMatToOpOutput>& cvMatToOpOutput);

virtual ~WCvMatToOpOutput();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -39,6 +41,11 @@ namespace op
{
}

template<typename TDatums>
WCvMatToOpOutput<TDatums>::~WCvMatToOpOutput()
{
}

template<typename TDatums>
void WCvMatToOpOutput<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wKeepTopNPeople.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WKeepTopNPeople(const std::shared_ptr<KeepTopNPeople>& keepTopNPeople);

virtual ~WKeepTopNPeople();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -36,6 +38,11 @@ namespace op
{
}

template<typename TDatums>
WKeepTopNPeople<TDatums>::~WKeepTopNPeople()
{
}

template<typename TDatums>
void WKeepTopNPeople<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wKeypointScaler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WKeypointScaler(const std::shared_ptr<KeypointScaler>& keypointScaler);

virtual ~WKeypointScaler();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -36,6 +38,11 @@ namespace op
{
}

template<typename TDatums>
WKeypointScaler<TDatums>::~WKeypointScaler()
{
}

template<typename TDatums>
void WKeypointScaler<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wOpOutputToCvMat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WOpOutputToCvMat(const std::shared_ptr<OpOutputToCvMat>& opOutputToCvMat);

virtual ~WOpOutputToCvMat();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -38,6 +40,11 @@ namespace op
{
}

template<typename TDatums>
WOpOutputToCvMat<TDatums>::~WOpOutputToCvMat()
{
}

template<typename TDatums>
void WOpOutputToCvMat<TDatums>::initializationOnThread()
{
Expand Down
7 changes: 7 additions & 0 deletions include/openpose/core/wScaleAndSizeExtractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace op
public:
explicit WScaleAndSizeExtractor(const std::shared_ptr<ScaleAndSizeExtractor>& scaleAndSizeExtractor);

virtual ~WScaleAndSizeExtractor();

void initializationOnThread();

void work(TDatums& tDatums);
Expand All @@ -39,6 +41,11 @@ namespace op
{
}

template<typename TDatums>
WScaleAndSizeExtractor<TDatums>::~WScaleAndSizeExtractor()
{
}

template<typename TDatums>
void WScaleAndSizeExtractor<TDatums>::initializationOnThread()
{
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/face/faceCpuRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace op
FaceCpuRenderer(const float renderThreshold, const float alphaKeypoint = FACE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = FACE_DEFAULT_ALPHA_HEAT_MAP);

virtual ~FaceCpuRenderer();

void renderFaceInherited(Array<float>& outputData, const Array<float>& faceKeypoints);

DELETE_COPY(FaceCpuRenderer);
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/face/faceDetector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace op
public:
explicit FaceDetector(const PoseModel poseModel);

virtual ~FaceDetector();

std::vector<Rectangle<float>> detectFaces(const Array<float>& poseKeypoints) const;

private:
Expand Down
2 changes: 2 additions & 0 deletions include/openpose/face/faceDetectorOpenCV.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace op
public:
explicit FaceDetectorOpenCV(const std::string& modelFolder);

virtual ~FaceDetectorOpenCV();

// No thread-save
std::vector<Rectangle<float>> detectFaces(const cv::Mat& cvInputData);

Expand Down
2 changes: 1 addition & 1 deletion include/openpose/face/faceGpuRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace op
const float alphaKeypoint = FACE_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = FACE_DEFAULT_ALPHA_HEAT_MAP);

~FaceGpuRenderer();
virtual ~FaceGpuRenderer();

void initializationOnThread();

Expand Down
2 changes: 2 additions & 0 deletions include/openpose/face/faceRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace op
class OP_API FaceRenderer
{
public:
virtual ~FaceRenderer(){};

virtual void initializationOnThread(){};

void renderFace(Array<float>& outputData, const Array<float>& faceKeypoints,
Expand Down
Loading

0 comments on commit e59215a

Please sign in to comment.