提交 e59215a2 编写于 作者: G gineshidalgo99

Virtual destructors for all classes

上级 2cb16970
......@@ -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)
......@@ -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.
......@@ -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:
......@@ -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:
......@@ -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
......@@ -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.
......
......@@ -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`).
......@@ -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.
......
......@@ -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__);
......
......@@ -11,6 +11,8 @@ namespace op
public:
explicit CameraParameterReader();
virtual ~CameraParameterReader();
// cameraExtrinsics is optional
explicit CameraParameterReader(const std::string& serialNumber,
const cv::Mat& cameraIntrinsics,
......
......@@ -22,6 +22,8 @@ namespace op
JointAngleEstimation(const bool returnJacobian);
virtual ~JointAngleEstimation();
void initializationOnThread();
void adamFastFit(Eigen::Matrix<double, 62, 3, Eigen::RowMajor>& adamPose,
......
......@@ -11,6 +11,8 @@ namespace op
public:
PoseTriangulation(const int minViews3d);
virtual ~PoseTriangulation();
void initializationOnThread();
Array<float> reconstructArray(const std::vector<Array<float>>& keypointsVector,
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WJointAngleEstimation(const std::shared_ptr<JointAngleEstimation>& jointAngleEstimation);
virtual ~WJointAngleEstimation();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WJointAngleEstimation<TDatums>::~WJointAngleEstimation()
{
}
template<typename TDatums>
void WJointAngleEstimation<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPoseTriangulation(const std::shared_ptr<PoseTriangulation>& poseTriangulation);
virtual ~WPoseTriangulation();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPoseTriangulation<TDatums>::~WPoseTriangulation()
{
}
template<typename TDatums>
void WPoseTriangulation<TDatums>::initializationOnThread()
{
......
......@@ -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;
......
......@@ -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>>
......
......@@ -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:
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WCvMatToOpInput(const std::shared_ptr<CvMatToOpInput>& cvMatToOpInput);
virtual ~WCvMatToOpInput();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WCvMatToOpInput<TDatums>::~WCvMatToOpInput()
{
}
template<typename TDatums>
void WCvMatToOpInput<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WCvMatToOpOutput(const std::shared_ptr<CvMatToOpOutput>& cvMatToOpOutput);
virtual ~WCvMatToOpOutput();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WCvMatToOpOutput<TDatums>::~WCvMatToOpOutput()
{
}
template<typename TDatums>
void WCvMatToOpOutput<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WKeepTopNPeople(const std::shared_ptr<KeepTopNPeople>& keepTopNPeople);
virtual ~WKeepTopNPeople();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -36,6 +38,11 @@ namespace op
{
}
template<typename TDatums>
WKeepTopNPeople<TDatums>::~WKeepTopNPeople()
{
}
template<typename TDatums>
void WKeepTopNPeople<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WKeypointScaler(const std::shared_ptr<KeypointScaler>& keypointScaler);
virtual ~WKeypointScaler();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -36,6 +38,11 @@ namespace op
{
}
template<typename TDatums>
WKeypointScaler<TDatums>::~WKeypointScaler()
{
}
template<typename TDatums>
void WKeypointScaler<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WOpOutputToCvMat(const std::shared_ptr<OpOutputToCvMat>& opOutputToCvMat);
virtual ~WOpOutputToCvMat();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WOpOutputToCvMat<TDatums>::~WOpOutputToCvMat()
{
}
template<typename TDatums>
void WOpOutputToCvMat<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WScaleAndSizeExtractor(const std::shared_ptr<ScaleAndSizeExtractor>& scaleAndSizeExtractor);
virtual ~WScaleAndSizeExtractor();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WScaleAndSizeExtractor<TDatums>::~WScaleAndSizeExtractor()
{
}
template<typename TDatums>
void WScaleAndSizeExtractor<TDatums>::initializationOnThread()
{
......
......@@ -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);
......
......@@ -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:
......
......@@ -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);
......
......@@ -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();
......
......@@ -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,
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WFaceDetector(const std::shared_ptr<FaceDetector>& faceDetector);
virtual ~WFaceDetector();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WFaceDetector<TDatums>::~WFaceDetector()
{
}
template<typename TDatums>
void WFaceDetector<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WFaceDetectorOpenCV(const std::shared_ptr<FaceDetectorOpenCV>& faceDetectorOpenCV);
virtual ~WFaceDetectorOpenCV();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WFaceDetectorOpenCV<TDatums>::~WFaceDetectorOpenCV()
{
}
template<typename TDatums>
void WFaceDetectorOpenCV<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WFaceExtractorNet(const std::shared_ptr<FaceExtractorNet>& faceExtractorNet);
virtual ~WFaceExtractorNet();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WFaceExtractorNet<TDatums>::~WFaceExtractorNet()
{
}
template<typename TDatums>
void WFaceExtractorNet<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WFaceRenderer(const std::shared_ptr<FaceRenderer>& faceRenderer);
virtual ~WFaceRenderer();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WFaceRenderer<TDatums>::~WFaceRenderer()
{
}
template<typename TDatums>
void WFaceRenderer<TDatums>::initializationOnThread()
{
......
......@@ -16,7 +16,7 @@ namespace op
const std::shared_ptr<const TotalModel>& totalModel = nullptr,
const double fps = 30.);
~BvhSaver();
virtual ~BvhSaver();
void initializationOnThread();
......
......@@ -23,7 +23,7 @@ namespace op
explicit CocoJsonSaver(const std::string& filePathToSave, const bool humanReadable = true,
const CocoJsonFormat cocoJsonFormat = CocoJsonFormat::Body);
~CocoJsonSaver();
virtual ~CocoJsonSaver();
void record(const Array<float>& poseKeypoints, const Array<float>& poseScores, const std::string& imageName);
......
......@@ -11,6 +11,8 @@ namespace op
protected:
explicit FileSaver(const std::string& directoryPath);
virtual ~FileSaver();
std::string getNextFileName(const unsigned long long index) const;
std::string getNextFileName(const std::string& fileNameNoExtension) const;
......
......@@ -11,6 +11,8 @@ namespace op
public:
HeatMapSaver(const std::string& directoryPath, const std::string& imageFormat);
virtual ~HeatMapSaver();
void saveHeatMaps(const std::vector<Array<float>>& heatMaps, const std::string& fileName) const;
private:
......
......@@ -12,6 +12,8 @@ namespace op
public:
ImageSaver(const std::string& directoryPath, const std::string& imageFormat);
virtual ~ImageSaver();
void saveImages(const std::vector<cv::Mat>& cvOutputDatas, const std::string& fileName) const;
private:
......
......@@ -11,7 +11,7 @@ namespace op
public:
explicit JsonOfstream(const std::string& filePath, const bool humanReadable = true);
~JsonOfstream();
virtual ~JsonOfstream();
void objectOpen();
......
......@@ -12,7 +12,10 @@ namespace op
public:
KeypointSaver(const std::string& directoryPath, const DataFormat format);
void saveKeypoints(const std::vector<Array<float>>& keypointVector, const std::string& fileName, const std::string& keypointName) const;
virtual ~KeypointSaver();
void saveKeypoints(const std::vector<Array<float>>& keypointVector, const std::string& fileName,
const std::string& keypointName) const;
private:
const DataFormat mFormat;
......
......@@ -11,6 +11,8 @@ namespace op
public:
PeopleJsonSaver(const std::string& directoryPath);
virtual ~PeopleJsonSaver();
void save(const std::vector<std::pair<Array<float>, std::string>>& keypointVector,
const std::vector<std::vector<std::array<float,3>>>& candidates,
const std::string& fileName, const bool humanReadable = true) const;
......
......@@ -10,6 +10,8 @@ namespace op
public:
UdpSender(const std::string& udpHost, const std::string& udpPort);
virtual ~UdpSender();
void sendJointAngles(const double* const adamPosePtr, const int adamPoseRows,
const double* const adamTranslationPtr,
const double* const adamFaceCoeffsExpPtr, const int faceCoeffRows);
......
......@@ -12,6 +12,8 @@ namespace op
public:
VideoSaver(const std::string& videoSaverPath, const int cvFourcc, const double fps, const Point<int>& cvSize);
virtual ~VideoSaver();
bool isOpened();
void write(const cv::Mat& cvMat);
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WBvhSaver(const std::shared_ptr<BvhSaver>& bvhSaver);
virtual ~WBvhSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WBvhSaver<TDatums>::~WBvhSaver()
{
}
template<typename TDatums>
void WBvhSaver<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WCocoJsonSaver(const std::shared_ptr<CocoJsonSaver>& cocoJsonSaver);
virtual ~WCocoJsonSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WCocoJsonSaver<TDatums>::~WCocoJsonSaver()
{
}
template<typename TDatums>
void WCocoJsonSaver<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WFaceSaver(const std::shared_ptr<KeypointSaver>& keypointSaver);
virtual ~WFaceSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WFaceSaver<TDatums>::~WFaceSaver()
{
}
template<typename TDatums>
void WFaceSaver<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WHandSaver(const std::shared_ptr<KeypointSaver>& keypointSaver);
virtual ~WHandSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WHandSaver<TDatums>::~WHandSaver()
{
}
template<typename TDatums>
void WHandSaver<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHeatMapSaver(const std::shared_ptr<HeatMapSaver>& heatMapSaver);
virtual ~WHeatMapSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHeatMapSaver<TDatums>::~WHeatMapSaver()
{
}
template<typename TDatums>
void WHeatMapSaver<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WImageSaver(const std::shared_ptr<ImageSaver>& imageSaver);
virtual ~WImageSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WImageSaver<TDatums>::~WImageSaver()
{
}
template<typename TDatums>
void WImageSaver<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPeopleJsonSaver(const std::shared_ptr<PeopleJsonSaver>& peopleJsonSaver);
virtual ~WPeopleJsonSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPeopleJsonSaver<TDatums>::~WPeopleJsonSaver()
{
}
template<typename TDatums>
void WPeopleJsonSaver<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WPoseSaver(const std::shared_ptr<KeypointSaver>& keypointSaver);
virtual ~WPoseSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WPoseSaver<TDatums>::~WPoseSaver()
{
}
template<typename TDatums>
void WPoseSaver<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WUdpSender(const std::shared_ptr<UdpSender>& udpSender);
virtual ~WUdpSender();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WUdpSender<TDatums>::~WUdpSender()
{
}
template<typename TDatums>
void WUdpSender<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WVideoSaver(const std::shared_ptr<VideoSaver>& videoSaver);
virtual ~WVideoSaver();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WVideoSaver<TDatums>::~WVideoSaver()
{
}
template<typename TDatums>
void WVideoSaver<TDatums>::initializationOnThread()
{
......
......@@ -24,6 +24,8 @@ namespace op
FrameDisplayer(const std::string& windowedName = OPEN_POSE_NAME_AND_VERSION,
const Point<int>& initialWindowedSize = Point<int>{}, const bool fullScreen = false);
virtual ~FrameDisplayer();
// Due to OpenCV visualization issues (all visualization functions must be in the same thread)
void initializationOnThread();
......
......@@ -24,6 +24,8 @@ namespace op
const std::vector<std::shared_ptr<Renderer>>& renderers = {},
const DisplayMode displayMode = DisplayMode::Display2D);
virtual ~Gui();
virtual void initializationOnThread();
void setImage(const cv::Mat& cvMatOutput);
......
......@@ -12,6 +12,8 @@ namespace op
public:
GuiInfoAdder(const int numberGpus, const bool guiEnabled = false);
virtual ~GuiInfoAdder();
void addInfo(cv::Mat& cvOutputData, const int numberPeople, const unsigned long long id,
const std::string& elementRenderedName, const unsigned long long frameNumber,
const Array<long long>& poseIds = Array<long long>{},
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WGui(const std::shared_ptr<Gui>& gui);
virtual ~WGui();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WGui<TDatums>::~WGui()
{
}
template<typename TDatums>
void WGui<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WGui3D(const std::shared_ptr<Gui3D>& gui3D);
virtual ~WGui3D();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WGui3D<TDatums>::~WGui3D()
{
}
template<typename TDatums>
void WGui3D<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WGuiAdam(const std::shared_ptr<GuiAdam>& guiAdam);
virtual ~WGuiAdam();
void initializationOnThread();
void workConsumer(const TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WGuiAdam<TDatums>::~WGuiAdam()
{
}
template<typename TDatums>
void WGuiAdam<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WGuiInfoAdder(const std::shared_ptr<GuiInfoAdder>& guiInfoAdder);
virtual ~WGuiInfoAdder();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WGuiInfoAdder<TDatums>::~WGuiInfoAdder()
{
}
template<typename TDatums>
void WGuiInfoAdder<TDatums>::initializationOnThread()
{
......
......@@ -14,6 +14,8 @@ namespace op
HandCpuRenderer(const float renderThreshold, const float alphaKeypoint = HAND_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = HAND_DEFAULT_ALPHA_HEAT_MAP);
virtual ~HandCpuRenderer();
void renderHandInherited(Array<float>& outputData, const std::array<Array<float>, 2>& handKeypoints);
DELETE_COPY(HandCpuRenderer);
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit HandDetector(const PoseModel poseModel);
virtual ~HandDetector();
std::vector<std::array<Rectangle<float>, 2>> detectHands(const Array<float>& poseKeypoints) const;
std::vector<std::array<Rectangle<float>, 2>> trackHands(const Array<float>& poseKeypoints);
......
......@@ -11,6 +11,8 @@ namespace op
public:
explicit HandDetectorFromTxt(const std::string& txtDirectoryPath);
virtual ~HandDetectorFromTxt();
std::vector<std::array<Rectangle<float>, 2>> detectHands();
private:
......
......@@ -15,7 +15,7 @@ namespace op
const float alphaKeypoint = HAND_DEFAULT_ALPHA_KEYPOINT,
const float alphaHeatMap = HAND_DEFAULT_ALPHA_HEAT_MAP);
~HandGpuRenderer();
virtual ~HandGpuRenderer();
void initializationOnThread();
......
......@@ -8,6 +8,8 @@ namespace op
class OP_API HandRenderer
{
public:
virtual ~HandRenderer(){};
virtual void initializationOnThread(){};
void renderHand(Array<float>& outputData, const std::array<Array<float>, 2>& handKeypoints,
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandDetector(const std::shared_ptr<HandDetector>& handDetector);
virtual ~WHandDetector();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandDetector<TDatums>::~WHandDetector()
{
}
template<typename TDatums>
void WHandDetector<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandDetectorFromTxt(const std::shared_ptr<HandDetectorFromTxt>& handDetectorFromTxt);
virtual ~WHandDetectorFromTxt();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandDetectorFromTxt<TDatums>::~WHandDetectorFromTxt()
{
}
template<typename TDatums>
void WHandDetectorFromTxt<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandDetectorTracking(const std::shared_ptr<HandDetector>& handDetector);
virtual ~WHandDetectorTracking();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandDetectorTracking<TDatums>::~WHandDetectorTracking()
{
}
template<typename TDatums>
void WHandDetectorTracking<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandDetectorUpdate(const std::shared_ptr<HandDetector>& handDetector);
virtual ~WHandDetectorUpdate();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandDetectorUpdate<TDatums>::~WHandDetectorUpdate()
{
}
template<typename TDatums>
void WHandDetectorUpdate<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandExtractorNet(const std::shared_ptr<HandExtractorNet>& handExtractorNet);
virtual ~WHandExtractorNet();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandExtractorNet<TDatums>::~WHandExtractorNet()
{
}
template<typename TDatums>
void WHandExtractorNet<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WHandRenderer(const std::shared_ptr<HandRenderer>& handRenderer);
virtual ~WHandRenderer();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WHandRenderer<TDatums>::~WHandRenderer()
{
}
template<typename TDatums>
void WHandRenderer<TDatums>::initializationOnThread()
{
......
......@@ -22,7 +22,7 @@ namespace op
public:
explicit BodyPartConnectorCaffe();
~BodyPartConnectorCaffe();
virtual ~BodyPartConnectorCaffe();
virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom);
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit MaximumCaffe();
virtual ~MaximumCaffe();
virtual void LayerSetUp(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
......
......@@ -8,6 +8,8 @@ namespace op
class OP_API Net
{
public:
virtual ~Net(){}
virtual void initializationOnThread() = 0;
virtual void forwardPass(const Array<float>& inputData) const = 0;
......
......@@ -21,6 +21,8 @@ namespace op
public:
explicit ResizeAndMergeCaffe();
virtual ~ResizeAndMergeCaffe();
virtual void LayerSetUp(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top);
virtual void Reshape(const std::vector<caffe::Blob<T>*>& bottom, const std::vector<caffe::Blob<T>*>& top,
......
......@@ -17,6 +17,8 @@ namespace op
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEAT_MAP,
const unsigned int elementToRender = 0u);
virtual ~PoseCpuRenderer();
std::pair<int, std::string> renderPose(Array<float>& outputData, const Array<float>& poseKeypoints,
const float scaleInputToOutput,
const float scaleNetToOutput = -1.f);
......
......@@ -19,7 +19,7 @@ namespace op
const float alphaHeatMap = POSE_DEFAULT_ALPHA_HEAT_MAP,
const unsigned int elementToRender = 0u);
~PoseGpuRenderer();
virtual ~PoseGpuRenderer();
void initializationOnThread();
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPoseExtractor(const std::shared_ptr<PoseExtractor>& poseExtractorSharedPtr);
virtual ~WPoseExtractor();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPoseExtractor<TDatums>::~WPoseExtractor()
{
}
template<typename TDatums>
void WPoseExtractor<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPoseExtractorNet(const std::shared_ptr<PoseExtractorNet>& poseExtractorSharedPtr);
virtual ~WPoseExtractorNet();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPoseExtractorNet<TDatums>::~WPoseExtractorNet()
{
}
template<typename TDatums>
void WPoseExtractorNet<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPoseRenderer(const std::shared_ptr<PoseRenderer>& poseRendererSharedPtr);
virtual ~WPoseRenderer();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPoseRenderer<TDatums>::~WPoseRenderer()
{
}
template<typename TDatums>
void WPoseRenderer<TDatums>::initializationOnThread()
{
......
......@@ -20,6 +20,8 @@ namespace op
const std::shared_ptr<std::pair<std::atomic<bool>,
std::atomic<int>>>& videoSeekSharedPtr = nullptr);
virtual ~DatumProducer();
std::pair<bool, std::shared_ptr<TDatumsNoPtr>> checkIfRunningAndGetDatum();
private:
......@@ -68,6 +70,11 @@ namespace op
}
}
template<typename TDatumsNoPtr>
DatumProducer<TDatumsNoPtr>::~DatumProducer()
{
}
template<typename TDatumsNoPtr>
std::pair<bool, std::shared_ptr<TDatumsNoPtr>> DatumProducer<TDatumsNoPtr>::checkIfRunningAndGetDatum()
{
......
......@@ -21,7 +21,7 @@ namespace op
explicit FlirReader(const std::string& cameraParametersPath, const Point<int>& cameraResolution,
const bool undistortImage = true, const int cameraIndex = -1);
~FlirReader();
virtual ~FlirReader();
std::vector<cv::Mat> getCameraMatrices();
......
......@@ -27,6 +27,8 @@ namespace op
explicit ImageDirectoryReader(const std::string& imageDirectoryPath, const unsigned int imageDirectoryStereo = 1,
const std::string& cameraParameterPath = "");
virtual ~ImageDirectoryReader();
std::vector<cv::Mat> getCameraMatrices();
std::vector<cv::Mat> getCameraExtrinsics();
......
......@@ -18,6 +18,8 @@ namespace op
*/
explicit IpCameraReader(const std::string& cameraPath);
virtual ~IpCameraReader();
std::vector<cv::Mat> getCameraMatrices();
std::vector<cv::Mat> getCameraExtrinsics();
......
......@@ -19,7 +19,7 @@ namespace op
explicit SpinnakerWrapper(const std::string& cameraParameterPath, const Point<int>& cameraResolution,
const bool undistortImage, const int cameraIndex = -1);
~SpinnakerWrapper();
virtual ~SpinnakerWrapper();
std::vector<cv::Mat> getRawFrames();
......
......@@ -26,6 +26,8 @@ namespace op
explicit VideoReader(const std::string& videoPath, const unsigned int imageDirectoryStereo = 1,
const std::string& cameraParameterPath = "");
virtual ~VideoReader();
std::vector<cv::Mat> getCameraMatrices();
std::vector<cv::Mat> getCameraExtrinsics();
......
......@@ -15,6 +15,8 @@ namespace op
public:
explicit WDatumProducer(const std::shared_ptr<DatumProducer<TDatumsNoPtr>>& datumProducer);
virtual ~WDatumProducer();
void initializationOnThread();
TDatums workProducer();
......@@ -41,6 +43,12 @@ namespace op
{
}
template<typename TDatums, typename TDatumsNoPtr>
WDatumProducer<TDatums, TDatumsNoPtr>::~WDatumProducer()
{
}
template<typename TDatums, typename TDatumsNoPtr>
void WDatumProducer<TDatums, TDatumsNoPtr>::initializationOnThread()
{
......
......@@ -26,7 +26,7 @@ namespace op
explicit WebcamReader(const int webcamIndex = 0, const Point<int>& webcamResolution = Point<int>{},
const double fps = 30., const bool throwExceptionIfNoOpened = true);
~WebcamReader();
virtual ~WebcamReader();
std::vector<cv::Mat> getCameraMatrices();
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit PriorityQueue(const long long maxSize = 256);
virtual ~PriorityQueue();
TDatums front() const;
private:
......@@ -40,6 +42,11 @@ namespace op
"Error: The type of the queue must be the same as the type of the container");
}
template<typename TDatums, typename TQueue>
PriorityQueue<TDatums, TQueue>::~PriorityQueue()
{
}
template<typename TDatums, typename TQueue>
TDatums PriorityQueue<TDatums, TQueue>::front() const
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit Queue(const long long maxSize);
virtual ~Queue();
TDatums front() const;
private:
......@@ -40,6 +42,11 @@ namespace op
"Error: The type of the queue must be the same as the type of the container");
}
template<typename TDatums, typename TQueue>
Queue<TDatums, TQueue>::~Queue()
{
}
template<typename TDatums, typename TQueue>
TDatums Queue<TDatums, TQueue>::front() const
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit SubThreadNoQueue(const std::vector<TWorker>& tWorkers);
virtual ~SubThreadNoQueue();
bool work();
DELETE_COPY(SubThreadNoQueue);
......@@ -29,7 +31,13 @@ namespace op
template<typename TDatums, typename TWorker>
SubThreadNoQueue<TDatums, TWorker>::SubThreadNoQueue(const std::vector<TWorker>& tWorkers) :
SubThread<TDatums, TWorker>{tWorkers}
{}
{
}
template<typename TDatums, typename TWorker>
SubThreadNoQueue<TDatums, TWorker>::~SubThreadNoQueue()
{
}
template<typename TDatums, typename TWorker>
bool SubThreadNoQueue<TDatums, TWorker>::work()
......
......@@ -14,6 +14,8 @@ namespace op
public:
SubThreadQueueIn(const std::vector<TWorker>& tWorkers, const std::shared_ptr<TQueue>& tQueueIn);
virtual ~SubThreadQueueIn();
bool work();
private:
......@@ -39,6 +41,11 @@ namespace op
// spTQueueIn->addPopper();
}
template<typename TDatums, typename TWorker, typename TQueue>
SubThreadQueueIn<TDatums, TWorker, TQueue>::~SubThreadQueueIn()
{
}
template<typename TDatums, typename TWorker, typename TQueue>
bool SubThreadQueueIn<TDatums, TWorker, TQueue>::work()
{
......
......@@ -12,7 +12,10 @@ namespace op
class SubThreadQueueInOut : public SubThread<TDatums, TWorker>
{
public:
SubThreadQueueInOut(const std::vector<TWorker>& tWorkers, const std::shared_ptr<TQueue>& tQueueIn, const std::shared_ptr<TQueue>& tQueueOut);
SubThreadQueueInOut(const std::vector<TWorker>& tWorkers, const std::shared_ptr<TQueue>& tQueueIn,
const std::shared_ptr<TQueue>& tQueueOut);
virtual ~SubThreadQueueInOut();
bool work();
......@@ -32,7 +35,8 @@ namespace op
namespace op
{
template<typename TDatums, typename TWorker, typename TQueue>
SubThreadQueueInOut<TDatums, TWorker, TQueue>::SubThreadQueueInOut(const std::vector<TWorker>& tWorkers, const std::shared_ptr<TQueue>& tQueueIn,
SubThreadQueueInOut<TDatums, TWorker, TQueue>::SubThreadQueueInOut(const std::vector<TWorker>& tWorkers,
const std::shared_ptr<TQueue>& tQueueIn,
const std::shared_ptr<TQueue>& tQueueOut) :
SubThread<TDatums, TWorker>{tWorkers},
spTQueueIn{tQueueIn},
......@@ -42,6 +46,11 @@ namespace op
spTQueueOut->addPusher();
}
template<typename TDatums, typename TWorker, typename TQueue>
SubThreadQueueInOut<TDatums, TWorker, TQueue>::~SubThreadQueueInOut()
{
}
template<typename TDatums, typename TWorker, typename TQueue>
bool SubThreadQueueInOut<TDatums, TWorker, TQueue>::work()
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
SubThreadQueueOut(const std::vector<TWorker>& tWorkers, const std::shared_ptr<TQueue>& tQueueOut);
virtual ~SubThreadQueueOut();
bool work();
private:
......@@ -39,6 +41,11 @@ namespace op
spTQueueOut->addPusher();
}
template<typename TDatums, typename TWorker, typename TQueue>
SubThreadQueueOut<TDatums, TWorker, TQueue>::~SubThreadQueueOut()
{
}
template<typename TDatums, typename TWorker, typename TQueue>
bool SubThreadQueueOut<TDatums, TWorker, TQueue>::work()
{
......
......@@ -19,6 +19,8 @@ namespace op
// Completely customizable case
explicit ThreadManager(const ThreadManagerMode threadManagerMode = ThreadManagerMode::Synchronous);
virtual ~ThreadManager();
void setDefaultMaxSizeQueues(const long long defaultMaxSizeQueues = -1);
void add(const unsigned long long threadId, const std::vector<TWorker>& tWorkers, const unsigned long long queueInId,
......@@ -101,6 +103,11 @@ namespace op
{
}
template<typename TDatums, typename TWorker, typename TQueue>
ThreadManager<TDatums, TWorker, TQueue>::~ThreadManager()
{
}
template<typename TDatums, typename TWorker, typename TQueue>
void ThreadManager<TDatums, TWorker, TQueue>::setDefaultMaxSizeQueues(const long long defaultMaxSizeQueues)
{
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WIdGenerator();
virtual ~WIdGenerator();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -39,6 +41,11 @@ namespace op
{
}
template<typename TDatums>
WIdGenerator<TDatums>::~WIdGenerator()
{
}
template<typename TDatums>
void WIdGenerator<TDatums>::initializationOnThread()
{
......
......@@ -19,6 +19,8 @@ namespace op
public:
explicit WQueueAssembler();
virtual ~WQueueAssembler();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -42,6 +44,11 @@ namespace op
{
}
template<typename TDatums, typename TDatumsNoPtr>
WQueueAssembler<TDatums, TDatumsNoPtr>::~WQueueAssembler()
{
}
template<typename TDatums, typename TDatumsNoPtr>
void WQueueAssembler<TDatums, TDatumsNoPtr>::initializationOnThread()
{
......@@ -57,7 +64,7 @@ namespace op
// Input TDatums -> enqueue it
if (checkNoNullNorEmpty(tDatums))
{
// Security check
// Sanity check
if (tDatums->size() > 1)
error("This function assumes that WQueueSplitter (inside WDatumProducer)"
" was applied in the first place, i.e., that there is only 1 element"
......
......@@ -14,6 +14,8 @@ namespace op
public:
explicit WQueueOrderer(const unsigned int maxBufferSize = 64u);
virtual ~WQueueOrderer();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -47,6 +49,11 @@ namespace op
{
}
template<typename TDatums>
WQueueOrderer<TDatums>::~WQueueOrderer()
{
}
template<typename TDatums>
void WQueueOrderer<TDatums>::initializationOnThread()
{
......
......@@ -13,6 +13,8 @@ namespace op
public:
explicit WPersonIdExtractor(const std::shared_ptr<PersonIdExtractor>& personIdExtractor);
virtual ~WPersonIdExtractor();
void initializationOnThread();
void work(TDatums& tDatums);
......@@ -38,6 +40,11 @@ namespace op
{
}
template<typename TDatums>
WPersonIdExtractor<TDatums>::~WPersonIdExtractor()
{
}
template<typename TDatums>
void WPersonIdExtractor<TDatums>::initializationOnThread()
{
......
......@@ -65,26 +65,24 @@ namespace op
}
// This class is thread-safe
class OP_API ConfigureError
namespace ConfigureError
{
public:
static std::vector<ErrorMode> getErrorModes();
OP_API std::vector<ErrorMode> getErrorModes();
static void setErrorModes(const std::vector<ErrorMode>& errorModes);
};
OP_API void setErrorModes(const std::vector<ErrorMode>& errorModes);
}
// This class is thread-safe
class OP_API ConfigureLog
namespace ConfigureLog
{
public:
static Priority getPriorityThreshold();
OP_API Priority getPriorityThreshold();
static const std::vector<LogMode>& getLogModes();
OP_API const std::vector<LogMode>& getLogModes();
static void setPriorityThreshold(const Priority priorityThreshold);
OP_API void setPriorityThreshold(const Priority priorityThreshold);
static void setLogModes(const std::vector<LogMode>& loggingModes);
};
OP_API void setLogModes(const std::vector<LogMode>& loggingModes);
}
}
#endif // OPENPOSE_UTILITIES_ERROR_AND_LOG_HPP
......@@ -47,7 +47,7 @@ namespace op
* Destructor.
* It automatically frees resources.
*/
~WrapperT();
virtual ~WrapperT();
/**
* Disable multi-threading.
......@@ -265,7 +265,7 @@ namespace op
{
try
{
// Security check
// Sanity check
if (worker == nullptr)
error("Your worker is a nullptr.", __LINE__, __FILE__, __FUNCTION__);
// Add worker
......
......@@ -24,15 +24,15 @@ namespace op
* @param userOutputWsEmpty
* @param threadManagerMode
*/
OP_API void wrapperConfigureSecurityChecks(WrapperStructPose& wrapperStructPose,
const WrapperStructFace& wrapperStructFace,
const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
const bool renderOutput,
const bool userOutputWsEmpty,
const ThreadManagerMode threadManagerMode);
OP_API void wrapperConfigureSanityChecks(WrapperStructPose& wrapperStructPose,
const WrapperStructFace& wrapperStructFace,
const WrapperStructHand& wrapperStructHand,
const WrapperStructExtra& wrapperStructExtra,
const WrapperStructInput& wrapperStructInput,
const WrapperStructOutput& wrapperStructOutput,
const bool renderOutput,
const bool userOutputWsEmpty,
const ThreadManagerMode threadManagerMode);
/**
* Thread ID increase (private internal function).
......@@ -139,9 +139,9 @@ namespace op
// Check no wrong/contradictory flags enabled
const auto userOutputWsEmpty = userOutputWs.empty();
wrapperConfigureSecurityChecks(wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra,
wrapperStructInput, wrapperStructOutput, renderOutput, userOutputWsEmpty,
threadManagerMode);
wrapperConfigureSanityChecks(wrapperStructPose, wrapperStructFace, wrapperStructHand, wrapperStructExtra,
wrapperStructInput, wrapperStructOutput, renderOutput, userOutputWsEmpty,
threadManagerMode);
// Get number threads
auto numberThreads = wrapperStructPose.gpuNumber;
......@@ -174,7 +174,7 @@ namespace op
+ " GPU(s), using " + std::to_string(numberThreads) + " of them starting at GPU "
+ std::to_string(gpuNumberStart) + ".", Priority::High);
}
// Security check
// Sanity check
if (gpuNumberStart + numberThreads > totalGpuNumber)
error("Initial GPU selected (`--number_gpu_start`) + number GPUs to use (`--number_gpu`) must"
" be lower or equal than the total number of GPUs in your machine ("
......@@ -740,7 +740,7 @@ namespace op
// The less number of queues -> the less threads opened, and potentially the less lag
// Security checks
// Sanity checks
if ((datumProducerW == nullptr) == (userInputWs.empty())
&& threadManagerMode != ThreadManagerMode::Asynchronous
&& threadManagerMode != ThreadManagerMode::AsynchronousIn)
......
......@@ -8,6 +8,10 @@ namespace op
{
}
CameraParameterReader::~CameraParameterReader()
{
}
CameraParameterReader::CameraParameterReader(const std::string& serialNumber,
const cv::Mat& cameraIntrinsics,
const cv::Mat& cameraDistortion,
......@@ -15,7 +19,7 @@ namespace op
{
try
{
// Security checks
// Sanity check
if (serialNumber.empty() || cameraIntrinsics.empty() || cameraDistortion.empty())
error("Camera intrinsics, distortion, and/or serialNumber cannot be empty.",
__LINE__, __FUNCTION__, __FILE__);
......@@ -118,7 +122,7 @@ namespace op
{
try
{
// Security check
// Sanity check
if (mSerialNumbers.size() != mCameraIntrinsics.size() || mSerialNumbers.size() != mCameraDistortions.size()
|| (mSerialNumbers.size() != mCameraIntrinsics.size() && !mCameraExtrinsics.empty()))
error("Arguments must have same size (mSerialNumbers, mCameraIntrinsics, mCameraDistortions,"
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册