Face Identification Time Observations

I’m using deepstack in a Ubuntu 18.04 VM (30G Ram, 8 cores, no GPU) in High mode.

I’m getting pretty good recognition times, in the order of 500ms.

One thing I have noticed, is that when there is an image with no faces in it (most of the time), the processing time is almost the same as when there is a face in the image.

If I use recognize, processing times are, as I say, about 500ms. If I use face, just to identify if there is a face or not, processing time is about 300ms.

I was hoping that processing time with no faces present would be less than with a face present, as this is slowing down my detection loop.

What I mean is, that I capture an image, process it, and loop. The worst case scenario is that I grab an image just before someone comes into the picture, so I have to process the empty frame, grab another frame, process it and recognize the face. This is giving me a worst case detection time of about 1.1 seconds, best case 600ms, average 900 mS.

If I grab a frame, check with face, and if there is a face, id with recognize this takes 900ms+, and works out about the same time (1.2s worst case, best case 900mS), so it isn’t any benefit (in fact overall it’s slower).

If the time to process a frame with no face in it could be reduced, this would actually improve the average face detection time significantly. I’m not using motion detection to trigger analysis, because the camera takes about 2 seconds to produce a stable image when you start up the stream, by which time you have missed the face (same for grabbing a still image).

Here are my timings, most of these have no face in them, but two do have registered faces (this is using a test image database).

[GIN] 2020/11/04 - 19:19:48 | 200 |  615.409059ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:49 | 200 |  509.792803ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:49 | 200 |  523.254858ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:50 | 200 |  502.574892ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:51 | 200 |  521.301081ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:51 | 200 |  525.489469ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:52 | 200 |  550.265035ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:53 | 200 |  598.675078ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:53 | 200 |  482.261619ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:54 | 200 |   587.59941ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:54 | 200 |  488.095136ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:55 | 200 |  478.819403ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:56 | 200 |   614.86998ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:56 | 200 |  504.197513ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:57 | 200 |   442.19396ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:58 | 200 |  652.486707ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:58 | 200 |  480.513553ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:59 | 200 |  550.366615ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:19:59 | 200 |  456.307348ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:00 | 200 |  593.890986ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:01 | 200 |  598.942762ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:02 | 200 |  658.944226ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:02 | 200 |  483.307618ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:03 | 200 |  490.103615ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:04 | 200 |   650.95952ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:04 | 200 |  616.173221ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:05 | 200 |  502.123062ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:05 | 200 |  444.825984ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:06 | 200 |  523.780594ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:07 | 200 |  484.988174ms |      172.17.0.1 | POST     /v1/vision/face/recognize
[GIN] 2020/11/04 - 19:20:07 | 200 |  433.563276ms |      172.17.0.1 | POST     /v1/vision/face/recognize

Hello @Nick_W, the /face api and the /recognize should be the same duration when no face is detected. I will run tests on my end to comfirm if this isn’t the case and work on fixing it. Thanks for the details.