face-alignment icon indicating copy to clipboard operation
face-alignment copied to clipboard

About speed of sfd and fan Inference

Open GuohongLi opened this issue 5 years ago • 9 comments

I tested the code on my nvidai k40 gpu,but both sfd and fan Inference are too slow. sfd=12s fan=3s around. May I know how fast you have tested ? Thx.

GuohongLi avatar Dec 11 '18 05:12 GuohongLi

@GuohongLi I have tested it on a 1080Ti and with a few optimisation I can get 20fps on a 640x480px video input ( fan+sfd )

1adrianb avatar Dec 19 '18 14:12 1adrianb

@1adrianb How about the net size? TINY, SMALL, MEDIUM, or LARGE ?

GuohongLi avatar Jan 04 '19 03:01 GuohongLi

@GuohongLi the smalles ones is 4x faster than the large one. The current model uploaded is "LARGE" (i.e. uses 4 stacks)

1adrianb avatar Jan 04 '19 22:01 1adrianb

Adrian, are fewer stacks models available at the moment? Large model is great, but it would be really nice to speed things up a bit.

SergeiSamuilov avatar Jan 11 '19 13:01 SergeiSamuilov

Hi, I ported the FAN pytorch model into onnx for faster inference. Also I use numba to accelerate the post processing step. You can see my repo. The only thing it might be a concern is that you need to install onnxruntime.

As for the speed, on my 1080Ti, sfd+fan pytorch gives 25FPS, and sfd+fan onnx+numba gives me 33FPS (a 10ms gain!). You may also use tensorrt to further boost the performance.

Aside from the model itself, another thing you can do is to do for example detection 1 frame over 2, and use linear interpolation on the frame without detection. That is also easy & elegant.

kwea123 avatar Oct 23 '19 14:10 kwea123

@1adrianb which kind of optimisation? As i am using 2080Ti and 640x480 resolution, still only get about 4fps..

Vampire-Vx avatar Oct 31 '19 08:10 Vampire-Vx

@GuohongLi the smalles ones is 4x faster than the large one. The current model uploaded is "LARGE" (i.e. uses 4 stacks) @1adrianb so you are testing the smallest one?

Vampire-Vx avatar Oct 31 '19 10:10 Vampire-Vx

@1adrianb So,how can we get other models?The large model is great,but i want to try faster model.

199906peng avatar Apr 10 '21 11:04 199906peng

Hi, I ported the FAN pytorch model into onnx for faster inference. Also I use numba to accelerate the post processing step.

was it on large model?

debasishaimonk avatar Dec 27 '23 05:12 debasishaimonk