Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting compile errors against latest OpenPose #10

Closed
Liffon opened this issue Oct 12, 2017 · 3 comments
Closed

Getting compile errors against latest OpenPose #10

Liffon opened this issue Oct 12, 2017 · 3 comments
Labels

Comments

@Liffon
Copy link

Liffon commented Oct 12, 2017

I'm getting the following errors when trying to build PyOpenPose:

[ 75%] Building CXX object PyOpenPoseLib/CMakeFiles/PyOpenPose.dir/opencv_expose.cpp.o
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:51:23: error: cannot declare field ‘OpenPoseWrapper::PrivateData::faceExtractor’ to be of abstract type ‘op::FaceExtractor’
     op::FaceExtractor faceExtractor;
                       ^
In file included from /home/liffon/openpose/include/openpose/face/headers.hpp:7:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:13:
/home/liffon/openpose/include/openpose/face/faceExtractor.hpp:14:18: note:   because the following virtual functions are pure within ‘op::FaceExtractor’:
     class OP_API FaceExtractor
                  ^
/home/liffon/openpose/include/openpose/face/faceExtractor.hpp:48:22: note: 	virtual void op::FaceExtractor::forwardPass(const std::vector<op::Rectangle<float> >&, const cv::Mat&, double)
         virtual void forwardPass(const std::vector<Rectangle<float>>& faceRectangles, cons
                      ^
/home/liffon/openpose/include/openpose/face/faceExtractor.hpp:71:22: note: 	virtual void op::FaceExtractor::netInitializationOnThread()
         virtual void netInitializationOnThread() = 0;
                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:55:23: error: cannot declare field ‘OpenPoseWrapper::PrivateData::handExtractor’ to be of abstract type ‘op::HandExtractor’
     op::HandExtractor handExtractor;
                       ^
In file included from /home/liffon/openpose/include/openpose/hand/headers.hpp:7:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:14:
/home/liffon/openpose/include/openpose/hand/handExtractor.hpp:14:18: note:   because the following virtual functions are pure within ‘op::HandExtractor’:
     class OP_API HandExtractor
                  ^
/home/liffon/openpose/include/openpose/hand/handExtractor.hpp:53:22: note: 	virtual void op::HandExtractor::forwardPass(std::vector<std::array<op::Rectangle<float>, 2ul> >, const cv::Mat&, double)
         virtual void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRe
                      ^
/home/liffon/openpose/include/openpose/hand/handExtractor.hpp:78:22: note: 	virtual void op::HandExtractor::netInitializationOnThread()
         virtual void netInitializationOnThread() = 0;
                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In constructor ‘OpenPoseWrapper::PrivateData::PrivateData(const op::Point<int>&, const op::Point<int>&, const op::Point<int>&, const op::Point<int>&, const op::Point<int>&, const op::PoseModel&, const string&, int, float, float, const std::vector<op::HeatMapType>&, const op::ScaleMode&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:41:114: error: too many initializers for ‘op::CvMatToOpInput’
 r{netInputSizeFace, netOutputSizeFace, modelFolder, 0, 1, 0.4, heatMapTypes, heatMapScale}
                                                                                          ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:41:114: error: too many initializers for ‘op::CvMatToOpOutput’
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:41:114: error: no matching function for call to ‘op::PoseGpuRenderer::PoseGpuRenderer(<brace-enclosed initializer list>)’
In file included from /home/liffon/openpose/include/openpose/pose/headers.hpp:11:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:12:
/home/liffon/openpose/include/openpose/pose/poseGpuRenderer.hpp:16:9: note: candidate: op::PoseGpuRenderer::PoseGpuRenderer(op::PoseModel, const std::shared_ptr<op::PoseExtractor>&, float, bool, float, float, unsigned int)
         PoseGpuRenderer(const PoseModel poseModel, const std::shared_ptr<PoseExtractor>& p
         ^
/home/liffon/openpose/include/openpose/pose/poseGpuRenderer.hpp:16:9: note:   no known conversion for argument 1 from ‘const op::Point<int>’ to ‘op::PoseModel’
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:41:114: error: no matching function for call to ‘op::FaceExtractor::FaceExtractor(<brace-enclosed initializer list>)’
 r{netInputSizeFace, netOutputSizeFace, modelFolder, 0, 1, 0.4, heatMapTypes, heatMapScale}
                                                                                          ^
In file included from /home/liffon/openpose/include/openpose/face/headers.hpp:7:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:13:
/home/liffon/openpose/include/openpose/face/faceExtractor.hpp:22:18: note: candidate: op::FaceExtractor::FaceExtractor(const op::Point<int>&, const op::Point<int>&, const std::vector<op::HeatMapType>&, op::ScaleMode)
         explicit FaceExtractor(const Point<int>& netInputSize, const Point<int>& netOutput
                  ^
/home/liffon/openpose/include/openpose/face/faceExtractor.hpp:22:18: note:   candidate expects 4 arguments, 6 provided
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:41:114: error: no matching function for call to ‘op::HandExtractor::HandExtractor(<brace-enclosed initializer list>)’
 r{netInputSizeFace, netOutputSizeFace, modelFolder, 0, 1, 0.4, heatMapTypes, heatMapScale}
                                                                                          ^
In file included from /home/liffon/openpose/include/openpose/hand/headers.hpp:7:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:14:
/home/liffon/openpose/include/openpose/hand/handExtractor.hpp:25:18: note: candidate: op::HandExtractor::HandExtractor(const op::Point<int>&, const op::Point<int>&, short unsigned int, float, const std::vector<op::HeatMapType>&, op::ScaleMode)
         explicit HandExtractor(const Point<int>& netInputSize, const Point<int>& netOutput
                  ^
/home/liffon/openpose/include/openpose/hand/handExtractor.hpp:25:18: note:   candidate expects 6 arguments, 8 provided
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘void OpenPoseWrapper::detectPose(const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:131:71: error: ‘class op::CvMatToOpInput’ has no member named ‘format’
     std::tie(netInputArray, scaleRatios) = membersPtr->cvMatToOpInput.format(rgb);
                                                                       ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:133:96: error: no matching function for call to ‘op::PoseExtractorCaffe::forwardPass(op::Array<float>&, <brace-enclosed initializer list>, std::vector<float>&)’
 bersPtr->poseExtractorCaffe.forwardPass(netInputArray, {rgb.cols, rgb.rows}, scaleRatios);
                                                                                         ^
In file included from /home/liffon/openpose/include/openpose/pose/headers.hpp:10:0,
                 from /home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:12:
/home/liffon/openpose/include/openpose/pose/poseExtractorCaffe.hpp:24:14: note: candidate: virtual void op::PoseExtractorCaffe::forwardPass(const op::Array<float>&, const op::Point<int>&, const std::vector<double>&)
         void forwardPass(const Array<float>& inputNetData, const Point<int>& inputDataSize
              ^
/home/liffon/openpose/include/openpose/pose/poseExtractorCaffe.hpp:24:14: note:   no known conversion for argument 3 from ‘std::vector<float>’ to ‘const std::vector<double>&’
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘void OpenPoseWrapper::detectFace(const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:139:86: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
         BOOST_THROW_EXCEPTION(std::runtime_error("Face network was not initialized."));
                                                                                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘void OpenPoseWrapper::detectFace(const cv::Mat&, const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:155:86: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
         BOOST_THROW_EXCEPTION(std::runtime_error("Face network was not initialized."));
                                                                                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:159:120: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
 td::runtime_error("Invalid face rectangles format. Expected Nx4 mat with type CV_32SC1"));
                                                                                         ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘void OpenPoseWrapper::detectHands(const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:174:86: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
         BOOST_THROW_EXCEPTION(std::runtime_error("Hand network was not initialized."));
                                                                                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘void OpenPoseWrapper::detectHands(const cv::Mat&, const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:193:86: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
         BOOST_THROW_EXCEPTION(std::runtime_error("Hand network was not initialized."));
                                                                                      ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:197:120: error: ‘BOOST_THROW_EXCEPTION’ was not declared in this scope
 td::runtime_error("Invalid hand rectangles format. Expected Nx8 mat with type CV_32SC1"));
                                                                                         ^
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp: In member function ‘cv::Mat OpenPoseWrapper::render(const cv::Mat&)’:
/home/liffon/PyOpenPose/PyOpenPoseLib/OpenPoseWrapper.cpp:214:77: error: ‘class op::CvMatToOpOutput’ has no member named ‘format’
     std::tie(scaleInputToOutput, outputArray) = membersPtr->cvMatToOpOutput.format(rgb);
                                                                             ^
PyOpenPoseLib/CMakeFiles/PyOpenPose.dir/build.make:62: recipe for target 'PyOpenPoseLib/CMakeFiles/PyOpenPose.dir/OpenPoseWrapper.cpp.o' failed

If I'm correct, the error messages about op::FaceExtractor and op::HandExtractor messages are caused by a commit in OpenPose that changed them to be abstract classes.

The Boost errors I'm guessing are caused by this commit in OpenPose that caused Boost to no longer be included in the OpenPose headers (so we probably have to include them explicitly from PyOpenPose).

The ones with op::CvMatToOpInput and op::CvMatToOpOutput seem to come from the same commit as the op::FaceExtractor and op::HandExtractor errors, as does the op::PoseGpuRenderer one.

It might be worth mentioning that I've compiled OpenPose using CMake and installed it system-wide with sudo make install as suggested by the OpenPose documentation.

@sberryman
Copy link

Confirmed, also getting the same error.

@padeler padeler added the bug label Oct 13, 2017
@padeler
Copy link
Member

padeler commented Oct 13, 2017

Yes, the api changes were made on openpose commit: 5160a127fe871d39f38a0cf05d60200bbe84d2c8

I will commit a patch on Monday.

padeler pushed a commit that referenced this issue Oct 16, 2017
@padeler
Copy link
Member

padeler commented Oct 16, 2017

I pushed an update for the API changes in openpose.

@padeler padeler closed this as completed Oct 16, 2017
padeler added a commit that referenced this issue Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants