I have created a face recognition model in python using opencv and LBPHFaceRecognizer. The model training and prediction works absolutely fine upto 100 different faces(For each person I capture 50 images).
However, after training the model for 300 different people, the opencv is stuck forever while reading the model file for prediction.
The model is an xml file of size 9 GB.
Below is my code(partial):
import cv2
import os
def read_image_data():
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
model_path = os.path.join(model_path, 'model_file.xml')
face_recognizer.read(model_path) # The program gets stuck here and doesn't proceed. No error
predict_model(face_recognizer)
def predict_model(face_recognizer):
....
Library Versions:
opencv-contrib-python==4.4.0.40
opencv-python==4.4.0.40
I have tried in both windows 10 and ubuntu 20.04.
how do I proceed further about this? Can someone please help me?
readfunction?read()is the built-in read function I get from thecv2.face.LBPHFaceRecognizer_create()object. Not a user defined one.