0

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?

2
  • Can you share the readfunction? Commented Aug 19, 2020 at 10:26
  • read() is the built-in read function I get from the cv2.face.LBPHFaceRecognizer_create() object. Not a user defined one. Commented Aug 19, 2020 at 12:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.