ageitgey / ageitgey/face_recognition

face_recognition uses only one CPU core. Is there a way to run it multithreaded?

Open
#649 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56.8k
Forks
13.7k
PR merge metrics
No merged PRs in 30d

Description

  • face_recognition version: 1.2.3
  • dlib version: 19.16.99 from Git
  • Python version: Python 3.6.5 (default, Apr 1 2018, 05:46:30)
  • Operating System: Ubuntu 18.04

I am working on a program, that should recognize (identify) and track a lot of faces in real time.
Face_recognition is not fast enough and it uses only one CPU core. I tried to compile Dlib with Intel MKL and nothing has changed. Even in CNN mode no more than one core is used. But CNN mode was created for multithreaded parallel execution. It runs on CUDA in parallel, why it can not on CPU?

Is it possible to use face_recognition (face_locations and face_encodings) in multithread way?
Is it possible on pure Dlib or Is it a restriction within Dlib?

I know that I can make queue of frames and process each frame on it's own core.
But this is not an option in my case. I need to find and compare faces on each frame faster to have time to do another processing and inter-frame comparison.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the face_locations and face_encodings entry points and reviewing how they invoke dlib in CPU and CNN modes. The issue names no files or tests, so first establish the supported threading behavior and a reproducible real-time workload; done would require a documented, tested way to use multiple CPU cores, if feasible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.