ageitgey / ageitgey/face_recognition

how to use multiprocess to speed up face recognition or other dl module? Thanks.

Open
#682 1 comment 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
  • Python version: 3.6
  • Operating System: window 7 64bit
Description

I encounter a problem in redoing the example of "face_recognition-master\face_recognition\face_recognition_cli.py". I expect multiprocess can speed up face_recognition. But the speed of "--cpus 4" is same to "--cpus 1". My pc has 4 cores.
the code and pics in the zip. It be modified according to examples in face_recognition. Any suggestion is welcome. thank you.
face_recognition_multiprocess_problem.zip

What I Did

E:\image_process_project\ref_image_projects\face_recognition-master\face_recogni
tion>python face_recognition_cli.py .\imagefiles .\ccc\1.png --cpus 4
cpus: 4
.\ccc\1.png,a_ccc_20181112_15-42-25-521305
.\ccc\1.png,a_ccc_20181112_15-42-27-162399
.\ccc\1.png,a_ccc_20181112_15-42-34-66794
.\ccc\1.png,a_ccc_20181112_15-42-45-218432
.\ccc\1.png,a_ccc_20181112_15-42-50-438730
.\ccc\1.png,a_ccc_20181112_15-44-16-908676
.\ccc\1.png,a_ccc_20181112_15-44-2-346843
.\ccc\1.png,a_ccc_20181112_15-44-29-400391
.\ccc\1.png,a_ccc_20181112_15-44-3-508910
.\ccc\1.png,a_ccc_20181112_15-44-30-546456
.\ccc\1.png,a_ccc_20181112_15-44-31-970538
.\ccc\1.png,a_ccc_20181112_15-44-4-915990
.\ccc\1.png,a_ccc_20181112_15-44-44-778270
.\ccc\1.png,a_ccc_20181112_15-44-6-200064
.\ccc\1.png,a_ccc_20181112_15-45-14-391964
.\ccc\1.png,a_ccc_20181112_15-47-31-823825
time eclipsed: 0.718041181564331 second

--- cpus 1 -------
E:\image_process_project\ref_image_projects\face_recognition-master\face_recogni
tion>python face_recognition_cli.py .\imagefiles .\ccc\1.png --cpus 1
cpus: 1
.\ccc\1.png,a_ccc_20181112_15-42-25-521305
.\ccc\1.png,a_ccc_20181112_15-42-27-162399
.\ccc\1.png,a_ccc_20181112_15-42-34-66794
.\ccc\1.png,a_ccc_20181112_15-42-45-218432
.\ccc\1.png,a_ccc_20181112_15-42-50-438730
.\ccc\1.png,a_ccc_20181112_15-44-16-908676
.\ccc\1.png,a_ccc_20181112_15-44-2-346843
.\ccc\1.png,a_ccc_20181112_15-44-29-400391
.\ccc\1.png,a_ccc_20181112_15-44-3-508910
.\ccc\1.png,a_ccc_20181112_15-44-30-546456
.\ccc\1.png,a_ccc_20181112_15-44-31-970538
.\ccc\1.png,a_ccc_20181112_15-44-4-915990
.\ccc\1.png,a_ccc_20181112_15-44-44-778270
.\ccc\1.png,a_ccc_20181112_15-44-6-200064
.\ccc\1.png,a_ccc_20181112_15-45-14-391964
.\ccc\1.png,a_ccc_20181112_15-47-31-823825
time eclipsed: 0.8430483341217041 second

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 with face_recognition/face_recognition_cli.py and the attached reproduction, then run the documented commands with --cpus 1 and --cpus 4. Trace how the CLI uses the CPU count and compare the reported timings; done means the cause of the unchanged timing is identified and the issue has a verified fix or clear explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.