Skip to content

Conversation

@tegusi
Copy link
Contributor

@tegusi tegusi commented Apr 1, 2019

The interface is not definite so that python binding won't work.

resolves #1661

This pullrequest changes

landmark detector related files

@alalek
Copy link
Member

alalek commented Apr 1, 2019

No need to re-open PRs with the same topic. Just "force" push updated commits into your branch.

CV_WRAP virtual bool fit( InputArray image,
InputArray faces,
OutputArrayOfArrays landmarks ) = 0;
std::vector<Rect>& faces,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const reference for inputs

@alalek
Copy link
Member

alalek commented Apr 25, 2019

Thank you!

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • squash commits into one (for easy rebasing between branches)
  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@tegusi tegusi changed the base branch from master to 3.4 May 8, 2019 16:56
@tegusi
Copy link
Contributor Author

tegusi commented May 8, 2019

OK, I have fixed the pr, so I just need to wait for the regular merge?

@LaurentBerger
Copy link
Contributor

LaurentBerger commented May 8, 2019

Thanks! I clone your repo and build opencv and python binding. first C++ example is good. I try to test python binding but I have got an exception :

OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.1.0-dev) Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in cv::Mat::copyTo, file G:\Lib\opencv\modules\core\src\copy.cpp, line 254

my code is

path_to_opencv_extra ='f:/lib/' 
frame = cv.imread(path_to_opencv_extra + 'opencv_extra/testdata/cv/face/david1.jpg')
if frame is None:
    print("image not found")
    exit()
facemark = cv.face.createFacemarkLBF()
facemark.loadModel("F:/TestDNN/OpenFace/lbfmodel.yaml")
cascade = cv.CascadeClassifier(path_to_opencv_extra + 'opencv_extra/testdata/cv/face/lbpcascade_frontalface_improved.xml')
if cascade.empty() :
    print("cascade not found")
    exit()
faces = cascade.detectMultiScale(frame, 1.05,  2, cv.CASCADE_SCALE_IMAGE, (30, 30))
ok, landmarks = facemark.fit(frame, faces)

@LaurentBerger
Copy link
Contributor

my python binding is here for facemarklbf

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

However it would be nice to add some Python tests in a separate PR (misc/python/test/test_facemark.py).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants