goberoi/faceit

Failed to extract from image. Reason: bad allocation

twt-mse opened this issue · 1 comments

Running 'python faceit.py preprocess fallon_to_oliver' results in the error:

'Failed to extract from image: C:\projects\faceit\data\processed\fallon _bank.mp4_frames\frame_000.jpg. Reason: bad allocation'

The video download and extraction of frames works correctly. The error occurs when the script tries to extract the faces from the frame images. From what I have tracked down the error happens in the extract.py at the call to 'self.get_faces(image)':

def handleImage(self, filename):
    count = 0
    image = cv2.imread(filename)
    for idx, face in self.get_faces(image):
        count = idx
        resized_image = self.extractor.extract(image, face, 256)
        output_file = get_folder(self.output_dir) / Path(filename).stem
        cv2.imwrite(str(output_file) + str(idx) + Path(filename).suffix, resized_image)
    return count + 1

Does anyone know why this happens?

Did you ever figure out the solution to this?