faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Really slow extraction

Open fakinated opened this issue 8 years ago • 6 comments

I'm currently extracting with roughly 25 seconds per item (yes, I'm not kidding, it's not the other way round). I just finished extracting for 600 images in 4-5 hours. What am I doing wrong?

These are my parameters for extracting:

python faceswap.py extract -i ./tmp -o ./tmp/aligned -ae -D cnn

According to the console output the extraction process is using my GPU (GTX 970).

I tried extracting with the hog model before, which was faster but yielded very bad results (many faces had been missed). My images are 16x900 png files.

My system:

OS: Ubuntu 17.10 GPU: GTX 970 4GB CPU: Intel i5-6600k

fakinated avatar Apr 13 '18 19:04 fakinated

Did you compile DLIB yourself? If not then you are probably using the CPU for extraction. See here: https://github.com/davisking/dlib/issues/909

torzdf avatar Apr 13 '18 20:04 torzdf

I did, with CUDA support. I used the cnn extractor from https://github.com/dfaker/df before and had an extraction rate of about 3 it/s. But I will verify that everything is still setup up correctly...

fakinated avatar Apr 13 '18 20:04 fakinated

Okay, I reinstalled dlib with CUDA support - nothing changed.

According to nvidia-smi, python is using 3.6 GB of my VRAM (however GPU-util is only between 0% and 10%), so I guess it's running on the GPU(?).

Is there a way to check if dlib is running on the GPU or CPU?

fakinated avatar Apr 13 '18 20:04 fakinated

I had a similar issue a while back, and it turned out something had gone wrong with my CUDA install, so I had to blow it all away and reinstall CUDA and cuDNN. It might be worth checking the CUDA Samples and making sure that they build correctly:

https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#verify-installation

torzdf avatar Apr 13 '18 21:04 torzdf

I had a similar problem with a different solution. For me, it turned out to be a broken version of a dlib extension module in the main 'site-packages' folder. Once I removed that, the good version of dlib in 'site-packages/dlib-[version]' is able to be called correctly, and everything works.

MT-4ier avatar Apr 14 '18 00:04 MT-4ier

Finally found it! I somehow ended up with multiple versions of dlib installed next to each other... :man_facepalming:

Thanks for your time!

This issue can safely be closed now.

fakinated avatar Apr 14 '18 00:04 fakinated