richmondu / libfaceid

libfaceid is a research framework for prototyping of face recognition solutions. It seamlessly integrates multiple detection, recognition and liveness models w/ speech synthesis and speech recognition.
MIT License
488 stars 158 forks source link

File can't be opened for reading! in function 'cv::face::FaceRecognizer::read' #27

Open Jyothsna2795 opened 4 years ago

Jyothsna2795 commented 4 years ago

I have been trying basic example provided in read.me i got below error. Please help me

(libfaceid_env) E:\assignment\training\Image_recognition\libfaceid-master>python TRY1.PY Traceback (most recent call last): File "TRY1.PY", line 10, in face_encoder = FaceEncoder(model=FaceEncoderModels.DEFAULT, path=INPUT_DIR_MODEL_ENCODING, path_training=INPUT_DIR_MODEL_TRAINING, training=False) File "E:\assignment\training\Image_recognition\libfaceid-master\libfaceid\encoder.py", line 48, in init self._base = FaceEncoder_LBPH(path, path_training, training) File "E:\assignment\training\Image_recognition\libfaceid-master\libfaceid\encoder.py", line 98, in init self._clf.read(self._path_training + OUTPUT_LBPH_CLASSIFIER) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv_contrib\modules\face\src\facerec.cpp:61: error: (-2:Unspecified error) File can't be opened for reading! in function 'cv::face::FaceRecognizer::read'

richmondu commented 4 years ago

Haven't tried with OpenCV 4. This repo is still using: opencv-python==3.4.3.18 opencv-contrib-python==3.4.3.18

Refer to https://github.com/richmondu/libfaceid/blob/master/requirements.txt

Try installing opencv-contrib-python==4.2.0

harshsp31 commented 4 years ago

Hi @richmondu , Thanks for sharing the great work. I am facing the same problem. I also tried downgrading OpenCV to 3.4.3.18 but I still faced the same error. Please help!

FahriBilici commented 3 years ago

I have same error

MeenakshiArumugam commented 3 years ago

I'm also facing the same issue could you help pls