TomaszRewak / Face-Landmarking

Real time face landmarking using decision trees and NN autoencoders
MIT License
70 stars 6 forks source link

Can not compile it with VS2017 Debug option #1

Closed ywwyewenwei closed 5 years ago

ywwyewenwei commented 5 years ago

Hi,I can not build this project with DEBUG option, I am using VS2017.

TomaszRewak commented 5 years ago

Hey, Actually I've made a decision to remove the debug build configuration from the main project because it was simply too slow. I didn't find it useful and as such I didn't want to maintain it. Even in release mode basic breakpoints can provide some basic insight (though not all data is available there). I think that it shouldn't be too much work to recreate the debug configuration based on the release configuration.

ywwyewenwei commented 5 years ago

Hi Tomasz, You are doing a great job! I built the DEBUG configuration just for learnning. I am using VS2017 and OpenCV 4.01.

 1. If I add a preprocessor 'OPENCV_TRAITS_ENABLE_DEPRECATED', the DEBUG configuration can be compiled normally. otherwise, Some errors will be generated in the follow function:
     template<typename _Tp> inline
    _Tp& Mat::at(int i0, int i1)
   {
         CV_DbgAssert(dims <= 2);
         CV_DbgAssert(data);
         CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]);
         CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()));
         CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());
         return ((_Tp*)(data + step.p[0] * i0))[i1];
    }
    The error is: Error C2039 'channels': is not a member of 'cv::DataType<_Tp>' .
 2. After I added the preprocessor 'OPENCV_TRAITS_ENABLE_DEPRECATED', I built the project and run it with  '-type features' param successfully, and so as the two Python scripts.
     But, When run it with '-type example' param, the under line will throw a exception:
      **CV_DbgAssert(CV_ELEM_SIZE1(traits::Depth<_Tp>::value) == elemSize1());**
     Should I  bypass this exception?
     Thanks a lot.  
ywwyewenwei commented 5 years ago

The calling stack is :

cv::Mat::at<FaceLandmarking::Math::Vector >(int i0, int i1) FaceLandmarking::Regression::MaskRegressorBuffer::setValue(int x, int y, FaceLandmarking::Math::Vector offset) FaceLandmarking::Regression::MaskRegressor<194>::computeOffset(const FaceLandmarking::FeatureExtraction::HsvImage & image, FaceLandmarking::Math::Point point, unsigned int64 pointNumber, unsigned int64 iterations) FaceLandmarking::FaceLandmarker<194>::adjustMasks(const cv::Mat & frame, FaceLandmarking::Mask::FaceMask<194> & mask, int steps, int iterations) FaceLandmarking::FaceLandmarker<194>::adjustMasks(const cv::Mat & frame, int steps, int iterators) FaceLandmarking::App::example<194>(std::experimental::filesystem::v1::path dataPath)

ywwyewenwei commented 5 years ago

20190323080736

TomaszRewak commented 5 years ago

I'm also using VS 2017, but an older version of OpenCV 3.3.1 (as I've started working on this project quite some time ago). But I'm not sure if it's actually a version related problem. It seems that by default OpneCV supports processing of its built in types only. And I'm storing in the matrix object of my own class Math::Vector<float>, which doesn't have required traits. Here is an openCV thread regarding this problem: https://stackoverflow.com/questions/7195649/opencv-matrix-of-user-defined-type Does this project work for you in the release mode with the -example flag? That would help us determine if it's just an assertion the can be bypassed or is it a real compatibility problem.

ywwyewenwei commented 5 years ago

Hi,Tomasz Yes! The project can work. And I added a little function to OpenCV: template inline _Tp& Mat::myat(int i0, int i1) This function just remove the 'CV_DbgAssert' lines. Now I don't care it.

ywwyewenwei commented 5 years ago

Please tell me how to improve precision?Especially on side face. You can see some landmarks below: image image image image image image

TomaszRewak commented 5 years ago

Pressing space bar (when using the -example option) should perform one step of mask adjustment.

Niedz., 24.03.2019, 00:44 użytkownik ywwyewenwei notifications@github.com napisał:

Please tell me how to improve precision?Especially on side face. You can see some landmarks below: [image: image] https://user-images.githubusercontent.com/46886131/54873013-8df72500-4e08-11e9-87d5-d20501849596.png [image: image] https://user-images.githubusercontent.com/46886131/54873015-94859c80-4e08-11e9-9b29-9a365079b9f3.png [image: image] https://user-images.githubusercontent.com/46886131/54873016-9a7b7d80-4e08-11e9-9c54-b53421102b7c.png [image: image] https://user-images.githubusercontent.com/46886131/54873017-a0715e80-4e08-11e9-9dab-a47fe126cada.png [image: image] https://user-images.githubusercontent.com/46886131/54873020-a6673f80-4e08-11e9-9299-08499764289b.png [image: image] https://user-images.githubusercontent.com/46886131/54873021-ac5d2080-4e08-11e9-8e1b-9275acbbc1d4.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TomaszRewak/Face-Landmarking/issues/1#issuecomment-475914464, or mute the thread https://github.com/notifications/unsubscribe-auth/AFh2pBvl1IhfJorprB4WT6inW4HmRLp0ks5vZrxqgaJpZM4b9Z-F .

ywwyewenwei commented 5 years ago

Thanks a lot.

TomaszRewak commented 5 years ago

Thanks for taking your time to play with my project. If you have any more question, feel free to ask.