Spidy20/Attendace_management_system

error when mark attendance

gokul8983 opened this issue · 2 comments

D:\code\attendance test\Attendace_management_system-master>python AMS_Run.py
OpenCV Error: Bad argument (This LBPH model is not computed yet. Did you call the train method?) in cv::face::LBPH::predict, file C:\projects\opencv-python\opencv_contrib\modules\face\src\l
bph_faces.cpp, line 396
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Personal\AppData\Local\Programs\Python\Python36\lib\tkinter_init_.py", line 1699, in call
return self.func(*args)
File "AMS_Run.py", line 349, in Fillattendances
Id, conf = recognizer.predict(gray[y:y + h, x:x + w])
cv2.error: C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:396: error: (-5) This LBPH model is not computed yet. Did you call the train method? in function cv::face
::LBPH::predict

Hey it's look like you forgot to train your model, and you are predicting attendance, please first create a model(.yml file) then predict the attendance.

Still haing same issue
File "AMS_Run.py", line 349, in Fillattendances
cv2.error: C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:396: error: (-5) This LBPH model is not computed yet. Did you call the train method? in function cv::face
::LBPH::predict

i request if it is possible for you to provide steps to solve this issue.