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

How can I Speed up the modle #8

Open
seasonyang opened this issue Nov 23, 2017 · 10 comments
Open

How can I Speed up the modle #8

seasonyang opened this issue Nov 23, 2017 · 10 comments

Comments

@seasonyang
Copy link

The speed is very slow, and imges delay to the camera.
How to optimize it to speed up it's speed?

@MarekKowalski
Copy link
Owner

Hi,

The current version is slow because the face alignment method (from the dlib library) requires face detection to run in every frame.
I have a version which uses Deep Alignment Network, a method published in one of my other repos for face alignment. I plan to include that version in this repo, but I don't have time to work on it right now.

For now you can download this faster version from Dropbox here:
https://www.dropbox.com/sh/yfq0hcu0we2hed0/AABXckFonehfgLfdzicjqqJYa?dl=0

Keep in mind that you need to install additional Python modules as detailed in the Deep Alignment Network repo. You will also need a gpu compatible with CUDA if you want it to work fast.

Let me know if that helps.

Marek

@seasonyang
Copy link
Author

seasonyang commented Nov 27, 2017

@MarekKowalski
thank you for your help。
I have tried your idea,but when I run the new modle only using CPU,its speed is slowler than before.

@MarekKowalski
Copy link
Owner

Yeah, it defienietly has to run on GPU to be fast.

@minhazur-piash
Copy link

minhazur-piash commented Jan 30, 2018

How can I run this program on GPU, please let me know.

@MarekKowalski
Copy link
Owner

Hi,

If you mean the program I linked on Dropbox then please take a look at the installation requirements in this repo:
https://github.com/MarekKowalski/DeepAlignmentNetwork

Marek

@minhazur-piash
Copy link

minhazur-piash commented Jan 30, 2018

Hi,
Thanks for quick reply.
I don't have gpu compatible with CUDA,. Can I use openCL instead, if yes please let me know what changes I have to make.

Minhaz

@MarekKowalski
Copy link
Owner

Hi,

No idea, look at the theano documentation and see there (theano is the library that uses the GPU).

Marek

@minhazur-piash
Copy link

Hi,
Found out that utils.getFaceKeypoints(cameraImg, detector, predictor, prevShape2D) taking longer time and the reason behind dropping frames. Is there any workaround?
Thanks.
Minhaz.

@MarekKowalski
Copy link
Owner

Hi,

Are you using the version that I supplied above in dropbox or the version in the repo?
If the one in Dropbox, I would suggest trying to enable gpu support.
If you are using the other version you might want to try to perform face detection on downscaled images.

Marek

@MarekKowalski
Copy link
Owner

Hi,

The performance of the face alignment step (DAN) would definitely be lower than what you would get from a GPU equipped desktop computer. There would definitely be some room for performance improvements in other places, as there are some things that Python is very slow at. I am however not sure that it would be sufficiently fast.

One thing you might want to try to improve the DAN performance is to only use a single stage instead of two stages. You can specify that in the constructor parameters.

Best regards,

Marek

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