when I run "python facerec_from_webcam.py",the following error occurred:
Traceback (most recent call last):
File "facerec_from_webcam.py", line 1, in
import face_recognition
File "/usr/local/lib/python2.7/dist-packages/face_recognition/__init__.py", line 7, in
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/usr/local/lib/python2.7/dist-packages/face_recognition/api.py", line 18, in
pose_predictor = dlib.shape_predictor(predictor_model)
Boost.Python.ArgumentError: Python argument types in
shape_predictor.__init__(shape_predictor, str)
did not match C++ signature:
__init__(boost::python::api::object, std::string)
__init__(_object*)
My guess is that something is wrong with the face_recognition_models files. Can you try re-installing the face_recognition_models package with pip and make sure no errors occur?
OK, Thank you very much, I will try your suggestion.
At 2017-09-12 01:26:32, "Adam Geitgey" notifications@github.com wrote:
My guess is that something is wrong with the face_recognition_models files. Can you try re-installing the face_recognition_models package with pip and make sure no errors occur?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
I got same problem.some one can help?
File "/home/useease/kenwood/AlgorithmPlatform/venv/lib/python3.5/site-packages/face_recognition/api.py", line 18, in <module>
pose_predictor = dlib.shape_predictor(predictor_model)
Boost.Python.ArgumentError: Python argument types in
shape_predictor.__init__(shape_predictor, str)
did not match C++ signature:
__init__(boost::python::api::object, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
__init__(_object*)
I also have the same problem with Python 2.7 and Boost 1.65. I'm using Anaconda and installed Boost through the channel conda-forge. When I try to import the face_recognition module, I get this error message:
>>> import face_recognition
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/guel/anaconda2/envs/py27/lib/python2.7/site-packages/face_recognition/__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/home/guel/anaconda2/envs/py27/lib/python2.7/site-packages/face_recognition/api.py", line 18, in <module>
pose_predictor = dlib.shape_predictor(predictor_model)
Boost.Python.ArgumentError: Python argument types in
shape_predictor.__init__(shape_predictor, str)
did not match C++ signature:
__init__(boost::python::api::object, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
__init__(_object*)
I also get the same error when I try to use dlib.cnn_face_detection_model_v1 so I think it is related to some incompatibility related to Boost.. Can someone help?
same problem here , everything seems to have installed fine and the non-cnn face detector works fine
In [3]: import face_recognition
In [4]: import face_recognition_models
In [5]: face_recognition_models.cnn_face_detector_model_location()
Out[5]: '/usr/lib/python2.7/dist-packages/face_recognition_models/models/mmod_human_face_detector.dat'
In [6]: ls -l /usr/lib/python2.7/dist-packages/face_recognition_models/models/mmod_human_face_detector.dat
-rw-rw-r-- 1 jeremy jeremy 729940 Oct 30 14:45 /usr/lib/python2.7/dist-packages/face_recognition_models/models/mmod_human_face_detector.dat
The same as me .Do you solve this problem?
prl@prl-System-Product-Name:~/Downloads/face_recognition-master/examples$ python find_faces_in_picture.py
Traceback (most recent call last):
File "find_faces_in_picture.py", line 2, in
import face_recognition
File "/usr/local/lib/python2.7/dist-packages/face_recognition/__init__.py", line 7, in
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "/usr/local/lib/python2.7/dist-packages/face_recognition/api.py", line 18, in
pose_predictor = dlib.shape_predictor(predictor_model)
Boost.Python.ArgumentError: Python argument types in
shape_predictor.__init__(shape_predictor, str)
did not match C++ signature:
__init__(boost::python::api::object, std::string)
__init__(_object*)
I had met the same problem, and I solved it!!!
python:3.6(anaconda)
system:ubuntu17.10
dllib:19.7
use GPU: yes
Here is what I had done after the problem rose:
I reinstalled cmake following this guy:https://github.com/ageitgey/face_recognition/issues/120
Then, I rebuilded dlib-19.7 and recompiled it, then I reinstalled dlib, the command like this:
cd dlib
mkdir build
cd build
cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=0
cmake --build .
cd ..
python3 setup.py install --yes DLIB_USE_CUDA --no USE_AVX_INSTRUCTIONS
If you don't use GPU, command like this:
cd dlib
mkdir build
cd build
cmake ..
cmake --build .
cd ..
python3 setup.py install
then I reinstalled face_recognition:
pip uninstall face_recognition
pip install face_recognition
Finally, the problem solved,though I don't know why........
Wisgon‘s way helps me solve the problem.
顶楼上
Well done, thk u very much~
At 2018-01-02 15:01:53, "Wisgon Chen" notifications@github.com wrote:
I had met the same problem, and I solved it!!!
python:3.6(anaconda)
system:ubuntu17.10
dllib:19.7
use GPU: yes
Here is what I had done after the problem rose:
I reinstalled cmake following this guy:#120
Then, I rebuilded dlib-19.7 and recompiled it, then I reinstalled dlib, the command like this:
cd dlib
mkdir build
cd build
cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=0
cmake --build .
cd ..
python3 setup.py install --yes DLIB_USE_CUDA --no USE_AVX_INSTRUCTIONS
If you don't use GPU, command like this:
cd dlib
mkdir build
cd build
cmake ..
cmake --build .
cd ..
python3 setup.py install
then I reinstalled face_recognition:
pip uninstall face_recognition
pip install face_recognition
Finally, the problem solved!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Wisgon solve my problem. If your boost is no problem, you can try it according to the method provided by Wisgon. Note that sudo pip3 install dlib==19.5.0 does not solve my problem, I finally reinstall dlib according to Wisgon
Most helpful comment
I had met the same problem, and I solved it!!!
python:3.6(anaconda)
system:ubuntu17.10
dllib:19.7
use GPU: yes
Here is what I had done after the problem rose:
I reinstalled cmake following this guy:https://github.com/ageitgey/face_recognition/issues/120
Then, I rebuilded dlib-19.7 and recompiled it, then I reinstalled dlib, the command like this:
If you don't use GPU, command like this:
then I reinstalled face_recognition:
Finally, the problem solved,though I don't know why........