deepfakes / faceswap

Deepfakes Software For All
https://www.faceswap.dev
GNU General Public License v3.0
52.54k stars 13.24k forks source link

Issue with python faceswap.py -h #291

Closed nfersaonjco closed 6 years ago

nfersaonjco commented 6 years ago

I try using python3 faceswap.py -h in terminal

And I keep getting:

Call this program like this: ./face_recognition.py shape_predictor_5_face_landmarks.dat dlib_face_recognition_resnet_model_v1.dat ../examples/faces You can download a trained facial shape predictor and recognition model from: http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2 http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2

I can't make use of faceswap.py to do things like extracting and training. Does anyone know how to get past this?

3xtr3m3d commented 6 years ago

use help as this

python3 faceswap.py extract -h python3 faceswap.py train -h python3 faceswap.py convert -h

nfersaonjco commented 6 years ago

@3xtr3m3d Thanks a lot for the quick response! I just tried those. But unfortunately, all 3 of those still return the same message as I mentioned above: " Call this program like this: ./face_recognition.py shape_predictor_5_face_landmarks.dat dlib_face_recognition_resnet_model_v1.dat ../examples/faces You can download a trained facial shape predictor and recognition model from: http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2 http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2 " Would you have any other ideas?

Kirin-kun commented 6 years ago

I think you should create a directory somewhere and redo a clone of https://github.com/deepfakes/faceswap.git just to be safe.

Your repo seems to be mixed up with Davis King dlib's python examples or something.

https://github.com/davisking/dlib/blob/master/python_examples/face_recognition.py

nfersaonjco commented 6 years ago

@Kirin-kun Thanks a lot for the response! So I downloaded and redid the link you gave me following https://github.com/deepfakes/faceswap/blob/master/INSTALL.md

First issue was trying to run 'pip3 install -r requirements.txt'. Since wasn't any 'requirements.txt', I'd get an error.

So instead I ran 'pip3 install -r requirements-python36.txt'. When I did though, it eventually returned this toward the end:


Failed building wheel for scandir Running setup.py clean for scandir Running setup.py bdist_wheel for dlib ... error Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/tmpwj_n5gzxpip-wheel- --python-tag cp36: running bdist_wheel running build running build_py package init file 'dlib/init.py' not found (or not a regular file) running build_ext Invoking CMake setup: 'cmake /private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/build/lib.macosx-10.10-x86_64-3.6 -DPYTHON_EXECUTABLE=/usr/local/opt/python/bin/python3.6 -DCMAKE_BUILD_TYPE=Release' -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /usr/local/lib/python3.6/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler

  "/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

  Change Dir: /private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/build/temp.macosx-10.10-x86_64-3.6/CMakeFiles/CMakeTmp

  Run Build Command:"/usr/bin/make" "cmTC_6eb5a/fast"
  xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist
  Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
  See `man xcode-select` for more details.

CMake will not be able to correctly generate this project.

Call Stack (most recent call first): CMakeLists.txt

-- Configuring incomplete, errors occurred! See also "/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/build/temp.macosx-10.10-x86_64-3.6/CMakeFiles/CMakeOutput.log". See also "/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/build/temp.macosx-10.10-x86_64-3.6/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "", line 1, in File "/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/setup.py", line 238, in 'Topic :: Software Development', File "/usr/local/lib/python3.6/site-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 204, in run self.run_command('build') File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/setup.py", line 119, in run self.build_extension(ext) File "/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/setup.py", line 153, in build_extension subprocess.check_call(cmake_setup, cwd=build_folder) File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/dlib/build/lib.macosx-10.10-x86_64-3.6', '-DPYTHON_EXECUTABLE=/usr/local/opt/python/bin/python3.6', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.


Failed building wheel for dlib Running setup.py clean for dlib Failed to build scandir dlib Installing collected packages: scandir, h5py, pyyaml, Keras, opencv-python, tensorflow-tensorboard, tensorflow, dlib, Click, face-recognition-models, face-recognition, tqdm Running setup.py install for scandir ... error Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/scandir/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-blixhswu-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.macosx-10.10-x86_64-3.6 copying scandir.py -> build/lib.macosx-10.10-x86_64-3.6 running build_ext building '_scandir' extension creating build/temp.macosx-10.10-x86_64-3.6 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _scandir.c -o build/temp.macosx-10.10-x86_64-3.6/_scandir.o xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools. See man xcode-select for more details. error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/scandir/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-blixhswu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/xg/1dc_2ywj6052dcxm66j2jvcw0000gn/T/pip-build-r2ojh7_h/scandir/


When I try to run 'python3 faceswap.py -h' anyways, I get "ModuleNotFoundError: No module named 'face_recognition'".

Would you have a workaround for any of this? Much appreciated!

Kirin-kun commented 6 years ago

The Install.md is severely outdated, or inaccurate. You should install the requirements from requirements-gpu-python36-cuda9.txt (do you actually have an NVidia adapter?)

And I have a hunch you're trying to run it on OSX? I think you face an uphill struggle, It's missing the tools to build dlib.

There's something on google about typing xcode-select --reset or xcode-select --install to install the tools needed to build software on OSX.

Clorr commented 6 years ago

If you notice problem in install.md or any other documentation, please try to improve. You can edit directly the files on github, even without any knowledge of git. When editing directly on Github, this will take care of making a PR for you