How to speed up the deserialization function in dlib

I am using the C ++ version of dlib to extract the positions of facial cues in an image. I would like to shorten the lead time. It now takes about 2.5 seconds to execute the executed file and determine the landmark in one image.

After analysis, I found that the main bottleneck is the deserialization function, which takes the path to the shape predictor and loads that file into the shape predictor object. This function takes 1.5 seconds.

Below is a code snippet.

shape_predictor sp;
deserialize("shape_predictor_68_face_landmarks.dat") >> sp; 

      

I wonder if there might be a way to speed up the deserialization function.

+3


source to share





All Articles