mtcnn icon indicating copy to clipboard operation
mtcnn copied to clipboard

Taking too long to process images. How to leverage GPU properly?

Open aman-captech opened this issue 7 years ago • 8 comments

I am using TensorFlow 1.8.0. with a Nvidia 960M GPU. I have obtained the following results on two sets of 5 images with different resolutions: No. of images; Resolution; Runtime; GPU Memory used:
5; 3280x2460; 220secs; 3176Mib 5; 167x215; 61secs; 380Mib

Can anyone suggest why is it taking so long to process these images. The inference time seems to be way off from the benchmark results given in the repo. Also for the second set of low res. images why isn't more GPU memory being utilised to process faster? Am I unable to leverage the GPU properly? If yes, please help me out with how to go about this? Has anyone else experienced such results?

aman-captech avatar Oct 17 '18 11:10 aman-captech

Hi aman, Have you solved the problem as I am also facing the same problem. The inference time is way more than what is in the benchmark.

thelastfunction avatar Sep 13 '19 11:09 thelastfunction

Hi aman, I am facing the same problem too. Did you solve it? I wonder if we can predict on batch.

lishangqiu avatar Dec 23 '19 20:12 lishangqiu

Hi, I figured it out , you may not be doing inference on Batch on Images or It may be using CPU as default make sure that you have installed tensorflow-gpu and performed Inference on Batch of Images

thelastfunction avatar Jan 17 '20 06:01 thelastfunction

@thelastfunction How do you do batch of images? detect_faces doesn't accept a batch of images.

photoszzt avatar Apr 25 '20 23:04 photoszzt

@photoszzt I am facing the same problem too. Did you solve it? How to predict on batch?

JiaHeng-DLUT avatar Sep 30 '20 11:09 JiaHeng-DLUT

@JiaHeng-DLUT I switch to RetinaFace: https://github.com/deepinsight/insightface/tree/master/RetinaFace with this implementation: https://github.com/biubug6/Pytorch_Retinaface

photoszzt avatar Sep 30 '20 15:09 photoszzt

@photoszzt Thanks!

JiaHeng-DLUT avatar Oct 01 '20 01:10 JiaHeng-DLUT

First repository appeared to be removed, for me across three it looks like MTCNN is faster on CPU than GPU

chaudharyachint08 avatar Apr 12 '22 15:04 chaudharyachint08