Closed punnu97 closed 6 years ago
Hi Purnima, Can you specify the OpenCV version you are using now?
Hello, Yes, it is OpenCV version 3.4.0 and Python version 3.6.4
Hi Purnima, Please run the following command on your python console and share the results with me.
Hi Purnima, I got the fix for this issue. The issue is due to model.yaml file, you have to create new yaml file using the script "create_face_model.py". Please follow the steps below before running "create_face_model.py":
recognizer = cv2.face.createLBPHFaceRecognizer()
to
recognizer = cv2.face.LBPHFaceRecognizer_create()
recognizer.save("cont.yaml")
to
recognizer.save("model.yaml")
After this run "create_face_model.py" using command: python3 create_face_model.py -i data/
please note that data/
is the directory where you have put training images. You can replace the images in that directory with new dataset following the name convention mentioned in Readme file.
After that, you can run main.py
.
Hi Prashant,
Thanks a lot for your help! My issue is resolved now.
I am closing the issue.
OpenCV Error: Unspecified error (The node is neither a map nor an empty collection) in cvGetFileNodeByName, file C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp, line 891 Traceback (most recent call last): File "main.py", line 137, in
recognizer.read("model.yaml")
cv2.error: C:\projects\opencv-python\opencv\modules\core\src\persistence.cpp:891: error: (-2) The node is neither a map nor an empty collection in function cvGetFileNodeByName
Earlier there was ' recognizer.load("model.yaml") ' in the original code but there is no attribute 'load' attribute in new version of current opencv which has been replaced by 'read'.