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

"Invalid HAAR feature" and no face in image error #59

Open
jstray opened this issue Oct 18, 2019 · 3 comments
Open

"Invalid HAAR feature" and no face in image error #59

jstray opened this issue Oct 18, 2019 · 3 comments

Comments

@jstray
Copy link

jstray commented Oct 18, 2019

Attempting to run facemorpher in a docker container as described in the readme,

root@6411e86f84bd:/# facemorpher --src=/images/alyssa.jpg --dest=/images/ian.jpg --plot
Failed finding face points:  cascadedetect.cpp(569) : Unspecified error : > Invalid HAAR feature (expected: 'rw.r.x + rw.r.width <= W'), where
>     'rw.r.x + rw.r.width' is 15
> must be less than or equal to
>     'W' is 12

No face in /images/alyssa.jpg
Failed finding face points:  cascadedetect.cpp(569) : Unspecified error : > Invalid HAAR feature (expected: 'rw.r.x + rw.r.width <= W'), where
>     'rw.r.x + rw.r.width' is 15
> must be less than or equal to
>     'W' is 12

No face in /images/ian.jpg
Traceback (most recent call last):
  File "/usr/local/bin/facemorpher", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/facemorpher/morpher.py", line 149, in main
    args['--plot'], args['--background'])
  File "/usr/local/lib/python3.7/site-packages/facemorpher/morpher.py", line 134, in morpher
    src_img, src_points = next(images_points_gen)
StopIteration

The inputs are jpg files that open fine, and I've even grabbed alyssa.jpg from the README to ensure that my particular face images are not the problem.

@jstray jstray changed the title "No face in image" error "Invalid HAAR feature " and no face in image error Oct 18, 2019
@jstray jstray changed the title "Invalid HAAR feature " and no face in image error "Invalid HAAR feature" and no face in image error Oct 18, 2019
@akamatsu
Copy link

I got the same error and found the solution:

change
from facemorpher import locator
to
import locator

at line34 of morphed.py

@aanno
Copy link

aanno commented May 1, 2020

I had this as well and tried what @akamatsu said - but his suggestion is not working for me. From the example and this stackoverflow I would conclude that there should not be any hair - only plain faces to make it work. I'm not into opencv to have any clue if this could be improved...

@aanno
Copy link

aanno commented May 3, 2020

I tried this once more and what @akamatsu is working if you checkout the git repo, i.e. if you don't use facemorpher installed from pip. No idea why this is the case, though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants