Closed yvs997 closed 3 years ago
Hello, that is totally normal because face detector model (e.g. mtcnn, retinaface) is building in the first iteration of the for loop. Then, it's going to use the pre-built face detector in the following iterations.
In the API perspective, similar to previous scenario, it will return fast if the model is already built. You may build the model in initialization of the API.
Hello Serengil, Thanks to develop deepface library which is very useful to face recognition tools.
I try to using your
DeepFace.detectFace
method since i want to store embedding record to other database and augmented detected face into several version to enhance the dataset.However on my observation, i got a problem when calling a function detectFace with my own wrapper function:
when i try to simulate that call inside a loop, at the first iteration the processing time is about 10 sec:
Time to extract face: 10.532280206680298
, but drastically reduced for the next iteration (this is the output recorded for picture number 2-5:seconds which i consider normal due the CPU. I want to know whether there is a solution for this time consumption issue, especially if i want to use only
detectFace
as an API call in the future?