Open devchacha opened 5 years ago
@devchacha it worked for me when i removed the "scaleFactor=1.5" from the below line . faces = face_cascade.detectMultiScale(image_array, scaleFactor=1.5, minNeighbors=5)
recognizer.train(x_train, np.array(y_labels)) cv2.error: OpenCV(4.0.1) C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
How can I fix it
same problem
@ganeshkarthik77 and @Abderrahmen33
hello guys..i had the same problem and it worked with this: recognition=cv2.face.LBPHFaceRecognizer_create()
p.s: in the file face-train change the recognicer to recognition.
Neither of these solutions worked for me. I will try to find another solution but if anyone found another fix, please help.
Edit: After further testing, I have found that large images will not work. I do not know the limit, but keeping each image under 200kb seems to work.
i change the plan in using library face_recognition but problem in cmake always we find problem lol but i think with importing face_recognition its easy
@georgiakais thnks alot anyway
cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
How can I fix it
Hey Abderrahmen33. I see from the thread that you managed to solve the error. Mind helping? same error.
Same error, how can i fix it?
Use more than one folder of images
Traceback (most recent call last):
File "c:/Users/Kajal/Visual studio/Automated-Attendance-System-By-Real-Time-Face-Reccognition-master/scripts/train.py", line 54, in
having same error tried all the solutions above. plz help
https://www.youtube.com/watch?v=TOUMUzVy24A this a video that i made
[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& 12/06/20 à 12:04:41
On Fri, Jun 12, 2020 at 11:46 AM kajal86 notifications@github.com wrote:
Traceback (most recent call last): File "c:/Users/Kajal/Visual studio/Automated-Attendance-System-By-Real-Time-Face-Reccognition-master/scripts/train.py", line 54, in recognizer.train(faces,np.array(faceid)) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/codingforentrepreneurs/OpenCV-Python-Series/issues/10#issuecomment-643181838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIR5OQMRUMJ6ZFUUB7BGZHDRWH2ONANCNFSM4HFOTZ4A .
Abderrahmen plzzz help me i have save code as u but still i face this problem TypeError: Expected Ptr
gauravtak077 contact me in may email abderrahmen.melliti@esprit.tn
I looked closely at the error, and I found the solution. (probably)
Removing minNeighbors
and scaleFactor
worked.
I was try that but....error remain same...
On Wed, Jun 24, 2020, 12:36 AM MiguelCodes notifications@github.com wrote:
I looked closely at the error, and I found the solution. (probably)
Removing minNeighbors and scaleFactor worked.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codingforentrepreneurs/OpenCV-Python-Series/issues/10#issuecomment-648359247, or unsubscribe https://github.com/notifications/unsubscribe-auth/APXCTIW57UIGJHHGYB2HQOTRYD4LXANCNFSM4HFOTZ4A .
OpenCV(4.3.0) C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train' i am also facing this problem any one can help me
more than one sample means
recognizer.train(x_train, np.array(y_labels))
Traceback (most recent call last):
File "C:\Users\LENOVO\Desktop\OpenCV\faces-train.py", line 47, in
please help me I tried all the solutions but it's not working
What is tha problem ...
On Sun, Sep 13, 2020, 8:45 PM SuatKrky notifications@github.com wrote:
recognizer.train(x_train, np.array(y_labels))
Traceback (most recent call last): File "C:\Users\LENOVO\Desktop\OpenCV\faces-train.py", line 47, in recognizer.train(x_train, np.array(y_labels)) cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-rwld3ghi\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
please help me I tried all the solutions but it's not working
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codingforentrepreneurs/OpenCV-Python-Series/issues/10#issuecomment-691684116, or unsubscribe https://github.com/notifications/unsubscribe-auth/APXCTIX26UHEMQ4U3KL2STLSFTOZLANCNFSM4HFOTZ4A .
line 48, in
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-5rb_9df3\opencv_contrib\modules\face\src\lbph_faces.cpp:265: error: (-213:The function/feature is not implemented) Using Original Local Binary Patterns for feature extraction only works on single-channel images (given 16). Please pass the image data as a grayscale image! in function 'cv::face::elbp'
How can I fix this problem?
recognizer.train(faces, np.array(Ids)) cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-r2ue8w6k\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
How can I fix this problem?
The problem is rising because the classifier is getting more than one channel image(even you are using gray images) Solution is to again convert your image into Gray before training
Ex: def trainData( ): face_recognizer = cv2.face.LBPHFaceRecognizer_create() img=cv2.imread("data/1.jpg") face_recognizer.train([img],np.array([1])) return face_recognizer
Above code is giving error
Fix: def trainData( ): face_recognizer = cv2.face.LBPHFaceRecognizer_create() img=cv2.imread("data/1.jpg") img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # use this line to convert images into gray face_recognizer.train([img],np.array([1])) return face_recognizer
fix 'cv::face::LBPH::train' change size photo to "910x1137"
Thank You
On Fri, Jun 11, 2021 at 5:58 AM Zakaria Karim @.***> wrote:
fix 'cv::face::LBPH::train' change size photo to "910x1137"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codingforentrepreneurs/OpenCV-Python-Series/issues/10#issuecomment-859162486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQUQPIPXNFEXBCL4BJHMT3TSFGSPANCNFSM4HFOTZ4A .
-- Mosfiqun Nahid Hassan Phone:+880 15213 31607 E-mail: @.*** Web: www.mosfiqun.com
@devchacha it worked for me when i removed the "scaleFactor=1.5" from the below line . faces = face_cascade.detectMultiScale(image_array, scaleFactor=1.5, minNeighbors=5)
@Rohitshrimal Thanks, It worked for me as well
@Karthiktmv pleasure to know. Thanks
when i run this code "face_recognizer=cv2.face.LBPHFaceRecognizer_create()" i get an error "AttributeError: module 'cv2' has no attribute 'face'",how to fix it?
recognizer.train(x_train, np.array(y_labels)) cv2.error: OpenCV(4.0.1) C:\projects\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'
How can I fix it?