Speedup predict

asked 2016-02-10 04:59:16 -0600

Bilityuk gravatar image

Hello, can anybody share a solution how to reduce operation time for LBPHFaceRecognizer model->predict() method? When i load more than 100 faces to the trainset and after training start the prediction loop, it works very slow. How to increase the perfomance?

edit retag flag offensive close merge delete

Comments

Can you count the time of predict (from OpenCV) count the time of your function that does the prediction? Are you sure that the amount of time is in the predict function or near it, in your code?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-02-11 04:34:06 -0600 )edit
1

I am not sure.. Ok i understand the task.. I will measure the time of predict function with 10 faces in training set and with 200 faces. And let you know the results..

Bilityuk gravatar imageBilityuk ( 2016-02-11 06:23:44 -0600 )edit

For 10 faces it takes 3 msec For 200 faces it takes 40-45 msec

Bilityuk gravatar imageBilityuk ( 2016-02-11 13:27:35 -0600 )edit

10, you want to say 10 different persons, or a db of 10 faces for one person?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-02-12 03:00:40 -0600 )edit

No i mean one person. Firstly i run the code with 10 faces for one person and it took 3 msec, then i run 200 faces for the same person and it took 40-45 msec.

Bilityuk gravatar imageBilityuk ( 2016-02-12 10:26:09 -0600 )edit

I tried to use openMP to reduce work time of function, but result became worse. it takes 70-75 msec if i use openMP for predict:

#pragma omp parallel
{
    model->predict(preprocessedFace, label, confidence); 
}
Bilityuk gravatar imageBilityuk ( 2016-02-13 01:47:28 -0600 )edit
1

Can anybody help me please?

Bilityuk gravatar imageBilityuk ( 2016-02-13 01:48:05 -0600 )edit