Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

face encoding takes too much time in EC2 #910

Open
demoV opened this issue Aug 22, 2019 · 4 comments
Open

face encoding takes too much time in EC2 #910

demoV opened this issue Aug 22, 2019 · 4 comments

Comments

@demoV
Copy link

demoV commented Aug 22, 2019

  • face_recognition version: 1.2.3
  • Python version: 3.7.2
  • Operating System: Amazon Linux AMI 2018.03

Description

Hi,
I am trying to get face encoding in ec2 machine. But it is talking around ~7 sec.
Image has only one person.

What I Did

Spin up ec2 instance c5.2xlarge. run face_encodings = face_recognition.face_encodings(image, {face_locations}, 100) in python console.

Please help me to understand why it is too slow in ec2.

@khadrawy
Copy link

Have you tried it on some other machine other than ec2? Is it faster on your local machine? this method is single threaded (python nature) and you're asking for 100 iteration which definitely will take time. I tried this lib on DigitalOcean standard vCPU on image from this library and it took around 1 second to encode one image with only 1 iteration.
Having multiprocessors will not help you encode the image faster as, again, it is single threaded operation. However, multiprocessors could help you process more images at the same time using python's multiprocessing module to execute that method in parallel processes for different images.

@demoV
Copy link
Author

demoV commented Sep 17, 2019

Hi @khadrawy,
We are processing the live stream, which is getting processed in EC2. As we do not get the batch of images to run in multiprocessing.
Same piece of code runs much faster in local with 100 iterations.
Not able to figure out the exact problem with EC2.

@khadrawy
Copy link

How much faster does it run locally? which type of cpu do you have locally? what is the average size of the image?

@timiil
Copy link

timiil commented Jan 15, 2020

we are too slow too... we are using a 4 core arm64 processor which named rockchip rk3328, running in ubuntu 16.04, give a face.jpg to execute face_encodings method, need about 3-4 seconds. any idea to speed up this method?

BTW, the compare_faces method is also very SLOW :(

please give some help, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants