faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Very slow extraction with scripts vs fakeapp 1.1

Open frosty3907 opened this issue 8 years ago • 10 comments

1080ti + OC'd 2600k using winpython 3.6.2 cuda 9.0 and tensorflow 1.6

Training utilizes ~50% of the GPU now (which is better than the ~25% utilized with FA 1.1) but extraction doesn't seem to utilize the GPU at all (getting around 1.33it/s) wheras with FA 1.1 I get around 17it/s - tried CNN and it dropped down to taking nearly a minute per file. Although I say it doesn't utilize the GPU it still seems to use all 11GB of RAM on the GPU, just none of the compute cores or processor are in use. CPU is using about 17%.

Tried using extracted data from FA 1.1 with .py -convert but it just says 'no alignment found for file: x" for every file even tho --alignments points to the path with alignments.json

I would've thought the alignments.json from FA 1.1 was compatible so I'm not sure if the above is a separate issue or not.

frosty3907 avatar Mar 09 '18 06:03 frosty3907

It is likely that the alignment files are different from fakeapp, as fakeapp is a kind of a black box I'm not sure how those are generated.

Regarding extraction, do you have a lot of frames without faces? If so this fix I made #259 might help once it is merged.

Fakeapp as I far as I remember also for 1.1 used to jump up and down on gpu usage, here it is more stable, training goes way faster and will likely make up for the extra time spent on extract ;). People have been working on new training models that could make more use of your extra GPU resources.

babilio avatar Mar 09 '18 07:03 babilio

Woot. Faceswap extraction faster than Fakeapp.

iperov avatar Mar 09 '18 08:03 iperov

Yeah, I made multiple tests and faceswap's CNN extractor is now a lot better than FA. And faster.

Actually, the warning about "may fail on large images" is obsolete I think (at least for middle range GPUs) : I fed it large jpg images (3177x4770), 16Mb on disk, from a camera and it extracted the faces without complaining and it gave really crisp 256x256 faces.

My adapter is a GTX 1060 6Gb and the extractor works really good now, since the corrections that have been made.

FakeApp (at least 2.2) is a huge memory hog. If there is normal RAM available, it will use everything.

Kirin-kun avatar Mar 09 '18 09:03 Kirin-kun

Please discuss this in faceswap-playground

Clorr avatar Mar 09 '18 09:03 Clorr

I suggest ensuring your dlib build is using cuda and compiled optimally?

kvrooman avatar Mar 09 '18 16:03 kvrooman

How? Sorry I spent many hours installing various things to get this to work. The installation instructions seemed to miss out many key requirements.

frosty3907 avatar Mar 10 '18 01:03 frosty3907

after following the instructions https://github.com/deepfakes/faceswap/blob/master/INSTALL.md -pip uninstall dlib -you're gonna need to install cmake: https://cmake.org/download/ -download dlib from here and run the commands shown from command prompt: http://dlib.net/compile.html notice the line line where you have to specify the version of visual studio you have

babilio avatar Mar 10 '18 01:03 babilio

Thanks but just gets more errors: S:\desktop\dlib-19.9\examples\build>cmake --build . --config Release Error: could not load cache

follows S:\desktop\dlib-19.9\examples\build>cmake .. CMake Error in CMakeLists.txt: Failed to run MSBuild command:

MSBuild.exe

to get the value of VCTargetsPath:

The system cannot find the file specified

frosty3907 avatar Mar 11 '18 13:03 frosty3907

I think maybe this is because I've installed the wrong components in Visual Studio? There's dozens of options and I've tried installing all the likely suspects but still just keep getting the above error.

frosty3907 avatar Mar 12 '18 07:03 frosty3907

Have you tried visual studio 2015?

babilio avatar Mar 12 '18 11:03 babilio