face-alignment icon indicating copy to clipboard operation
face-alignment copied to clipboard

Memory not cleansed on CPU

Open ibmua opened this issue 4 years ago • 1 comments

When I use face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, device='cuda') or face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, face_detector='dlib') everything's fine. However, when I use face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, device='cpu') some garbage accumulates in memory and with every use the process that runs get_landmarks_from_image starts consuming more and more memory.

ibmua avatar Jul 20 '20 14:07 ibmua

you can put detector in separate file and run as python detector.py input.jpg output.npy garbage collector will do the job to free memory notice it would require additional file write/read, but no other solution seems to be easy

Kitty-sunray avatar Nov 11 '21 11:11 Kitty-sunray