e4s2022 / e4s Goto Github PK
View Code? Open in Web Editor NEW(CVPR 2023) E4S: Fine-grained Face Swapping via Regional GAN Inversion
Home Page: https://e4s2022.github.io
License: MIT License
(CVPR 2023) E4S: Fine-grained Face Swapping via Regional GAN Inversion
Home Page: https://e4s2022.github.io
License: MIT License
how to remove source image neck from result image?
Thanks
Thanks for your excellent work. I ran face_swap for each frame in the video but found the results were not smooth.
But in your video demo, the results are very nice, could you please tell me how to fix it?
Thanks for your help!
Hi, I see in my results that neck has hard edges. Same as in you shared image in this issue
Is there a way to solve for that? I also saw the youtube video, where a lambda variable is discussed as a controllable face swap attribute. How can one change that in the face_swap script?
Hello!
What is a model license?
Can I use it for commercial purpose?
Thanks!
Provide a way to do this without miniconda / anaconda.
How do you suggest modifying the code such that it keeps the expressions of the source image?
resolve this is the architecture error? @e4s2022
would anyone be so kind to make a docker image? unfortunately this is what I always end up resorting to, as for some reason everything crashes on both windows and ubuntu (wsl2). ive been trying to use this software for more than a week now, installing multiple torch/cudatoolkit versions to no avail.
Admin of the project, if youre reading this, please send me a message on telegram https://t.me/keronikateka
Thank you for sharing such a wonderful project, but when I use FFHQ pre-trained weights to swap my own data, the result is very bad, please tell me how to do it if I want to swap my own images.
Thanks for your work!
I wonder have you ever tried testing on the images that are not sampled from FFHQ? I test it on my daily images, and it returns bad results. (aligned faces are used and try on different resolution)
'''
Traceback (most recent call last):
File "e4s/scripts/face_swap.py", line 392, in
faceSwapping_pipeline(opts.source, opts.target, opts, save_dir=opts.output_dir,
File "python3.9/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "e4s/scripts/face_swap.py", line 314, in faceSwapping_pipeline
swapped_and_pasted = smooth_face_boundry(swapped_face_image, T, full_mask_image, radius=outer_dilation)
File "e4s/scripts/face_swap.py", line 95, in smooth_face_boundry
image_masked.putalpha(blurred_mask)
File "python3.9/site-packages/PIL/Image.py", line 1705, in putalpha
self.im.putband(alpha.im, band)
ValueError: images do not match
'''
Please assist. Thank you!
Hi, when I tried swap face operation:
python scripts/face_swap.py --source=example/input/faceswap/source.jpg --target=example/input/faceswap/target.jpg
the following error is reported:
Traceback (most recent call last):
File "scripts/face_swap.py", line 345, in <module>
generator, kp_detector, he_estimator, estimate_jacobian = init_facevid2vid_pretrained_model(face_vid2vid_cfg, face_vid2vid_ckpt)
File "/root/project/e4s-main/./src/pretrained/face_vid2vid/driven_demo.py", line 216, in init_facevid2vid_pretrained_model
generator, kp_detector, he_estimator = load_checkpoints(config_path=cfg_path, checkpoint_path=ckpt_path, gen="spade", cpu=False)
File "/root/project/e4s-main/./src/pretrained/face_vid2vid/driven_demo.py", line 49, in load_checkpoints
checkpoint = torch.load(checkpoint_path)
File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load
result = unpickler.load()
File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 1019, in persistent_load
load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 997, in load_tensor
storage = zip_file.get_storage_from_record(name, numel, torch._UntypedStorage).storage()._untyped()
RuntimeError: PytorchStreamReader failed reading file data/94709563812016: invalid header or archive is corrupted
It seems to be related to the pre-trained model 00000189-checkpoint.pth.tar
, but I downloaded it from the given link.
Can someone with a similar problem help me out?
Thanks.
https://github.com/deepinsight/insightface tested has been very accurate without any training. I haven't been able to run this lib successfully but curious if it produces better results than insightface without any training.
hi , the weight link of 00000189-checkpoint.pth.tar in the facevid2vid paper is gone,can you send me a copy one? thank you very much! my email is [email protected]
please suggest.
Thanks
用项目自带的图片测试没问题,但是用网上的图片测试,生成的结果惨不忍睹,都不敢传上来,怕吓着人。
Can someone create a google colab for this?
The training process encountered No such file or directory: './pretrained_ckpts/auxiliray/model.pth' This checkpoint does not seem to be mentioned?
Hi @e4s2022 , How can i control the percentage of the swapping ?
I hope to be able to run it on Windows. I haven't tried it yet and I'm not sure if it can be successful.
Hi, I was trying to run the demo with Pytorch v2.x. It seems that the swapped face is black.
When i switched the platform back to v1.x, it works.
Anyone had the same problem? Any suggestion to make this work with PT v2.x?
Thanks!
Hello,
I got this error : when I tried face swap.
Traceback (most recent call last):
File "/usr/lib64/python3.9/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib64/python3.9/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/root/e4s/scripts/face_swap.py", line 17, in
from src.pretrained.face_parsing.face_parsing_demo import init_faceParsing_p retrained_model, faceParsing_demo, vis_parsing_maps
File "/root/e4s/src/pretrained/face_parsing/face_parsing_demo.py", line 13, in
from src.pretrained.face_parsing.model import BiSeNet, seg_mean, seg_std
File "/root/e4s/src/pretrained/face_parsing/model.py", line 15, in
seg_mean = torch.from_numpy(np.array([[0.485, 0.456, 0.406]])).float().cuda( ).reshape(1,3,1,1)
File "/usr/local/lib64/python3.9/site-packages/torch/cuda/init.py", line 2 47, in _lazy_init
torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.a spx
Please suggest if this can be used with CPU instead of GPU.
Thanks.
(e4s) root@autodl-container-fe7811a13c-a73d6848:~/autodl-tmp/FinegrainedFace/e4s# python face_edit.py --source=./example/input/faceedit/source.jpg --reference=./example/input/faceedit/reference.jpg --region hair eyes --alpha=1
Traceback (most recent call last):
File "face_edit.py", line 107, in
editor = Editor(opts)
File "face_edit.py", line 34, in init
self.faceParsing_model = init_faceParsing_pretrained_model(self.opts.faceParser_name, self.opt.faceParsing_ckpt, self.opt.segnext_config)
AttributeError: 'Editor' object has no attribute 'opt'
this time i tried in ubuntu using wsl2 and conda
(e4s) user@LAPTOP-E4D0U85P:~/e4s$ python scripts/face_swap.py --source=example/input/faceswap/source.jpg --target=example/input/faceswap/target.jpg
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1516, in _run_ninja_build
subprocess.run(
File "/home/user/miniconda3/envs/e4s/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "scripts/face_swap.py", line 16, in
from src.pretrained.gpen.gpen_demo import init_gpen_pretrained_model, GPEN_demo
File "/home/user/e4s/scripts/src/pretrained/gpen/gpen_demo.py", line 15, in
from src.pretrained.gpen.face_enhancement import FaceEnhancement
File "/home/user/e4s/scripts/src/pretrained/gpen/face_enhancement.py", line 11, in
from src.pretrained.gpen.face_model.face_gan import FaceGAN
File "/home/user/e4s/scripts/src/pretrained/gpen/face_model/face_gan.py", line 14, in
from src.pretrained.gpen.face_model.gpen_model import FullGenerator, FullGenerator_SR
File "/home/user/e4s/scripts/src/pretrained/gpen/face_model/gpen_model.py", line 16, in
from src.pretrained.gpen.face_model.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "/home/user/e4s/scripts/src/pretrained/gpen/face_model/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/home/user/e4s/scripts/src/pretrained/gpen/face_model/op/fused_act.py", line 13, in
fused = load(
File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 969, in load
return jit_compile(
File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1176, in jit_compile
write_ninja_file_and_build_library(
File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1280, in write_ninja_file_and_build_library
run_ninja_build(
File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1538, in run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'fused': [1/2] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/user/.local/lib/python3.8/site-packages/torch/include -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/TH -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/THC -isystem /home/user/miniconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /home/user/e4s/scripts/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/user/.local/lib/python3.8/site-packages/torch/include -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/TH -isystem /home/user/.local/lib/python3.8/site-packages/torch/include/THC -isystem /home/user/miniconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /home/user/e4s/scripts/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
ninja: build stopped: subcommand failed.
(e4s) user@LAPTOP-E4D0U85P:~/e4s$ conda list
_libgcc_mutex 0.1 main conda-forge
_openmp_mutex 5.1 1_gnu
blas 1.0 mkl conda-forge
brotlipy 0.7.0 py38h27cfd23_1003
bzip2 1.0.8 h7b6447c_0
ca-certificates 2023.01.10 h06a4308_0
certifi 2023.5.7 py38h06a4308_0
cffi 1.15.1 py38h5eee18b_3
charset-normalizer 2.0.4 pyhd3eb1b0_0
cryptography 39.0.1 py38h9ce1e76_0
cudatoolkit 11.1.74 h6bb024c_0 nvidia
dlib 19.24.0 py38he2161a6_0 conda-forge
ffmpeg 4.3 hf484d3e_0 pytorch
flit-core 3.8.0 py38h06a4308_0
freetype 2.12.1 h4a9f257_0
giflib 5.2.1 h5eee18b_3
gmp 6.2.1 h295c915_3
gnutls 3.6.15 he1e5248_0
idna 3.4 py38h06a4308_0
imageio 2.28.1 pypi_0 pypi
intel-openmp 2021.4.0 h06a4308_3561
jpeg 9e h5eee18b_1
lame 3.100 h7b6447c_0
lazy-loader 0.2 pypi_0 pypi
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.38 h1181459_1
lerc 3.0 h295c915_0
libblas 3.9.0 12_linux64_mkl conda-forge
libcblas 3.9.0 12_linux64_mkl conda-forge
libdeflate 1.17 h5eee18b_0
libffi 3.4.2 h6a678d5_6
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libiconv 1.16 h7f8727e_2
libidn2 2.3.2 h7f8727e_0
liblapack 3.9.0 12_linux64_mkl conda-forge
libpng 1.6.39 h5eee18b_0
libstdcxx-ng 11.2.0 h1234567_1
libtasn1 4.16.0 h27cfd23_0
libtiff 4.5.0 h6a678d5_2
libunistring 0.9.10 h27cfd23_0
libuv 1.44.2 h5eee18b_0
libwebp 1.2.4 h11a3e52_1
libwebp-base 1.2.4 h5eee18b_1
lz4-c 1.9.4 h6a678d5_0
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py38h7f8727e_0
mkl_fft 1.3.1 py38hd3c417c_0
mkl_random 1.2.2 py38h51133e4_0
ncurses 6.4 h6a678d5_0
nettle 3.7.3 hbbd107a_1
networkx 3.1 pypi_0 pypi
ninja 1.11.1 pypi_0 pypi
ninja-base 1.10.2 hd09550d_5
numpy 1.23.5 py38h14f4228_0
numpy-base 1.23.5 py38h31eccc5_0
opencv-python 4.7.0.72 pypi_0 pypi
openh264 2.1.1 h4ff587b_0
openssl 1.1.1t h7f8727e_0
packaging 23.1 pypi_0 pypi
pillow 9.4.0 py38h6a678d5_0
pip 23.0.1 py38h06a4308_0
pycparser 2.21 pyhd3eb1b0_0
pyopenssl 23.0.0 py38h06a4308_0
pysocks 1.7.1 py38h06a4308_0
python 3.8.16 h7a1cb2a_3
python_abi 3.8 2_cp38 conda-forge
pytorch 1.8.2 py3.8_cuda11.1_cudnn8.0.5_0 pytorch-lts
pytorch-mutex 1.0 cuda pytorch
pywavelets 1.4.1 pypi_0 pypi
pyyaml 6.0 pypi_0 pypi
readline 8.2 h5eee18b_0
requests 2.28.1 py38h06a4308_1
scikit-image 0.20.0 pypi_0 pypi
scipy 1.9.1 pypi_0 pypi
setuptools 65.6.3 py38h06a4308_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.1 h5eee18b_0
tifffile 2023.4.12 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
torch 1.10.1+cu113 pypi_0 pypi
torchaudio 0.10.1+cu113 pypi_0 pypi
torchvision 0.11.2+cu113 pypi_0 pypi
tqdm 4.65.0 pypi_0 pypi
typing_extensions 4.4.0 py38h06a4308_0
urllib3 1.26.15 py38h06a4308_0
wheel 0.38.4 py38h06a4308_0
xz 5.2.10 h5eee18b_1
zlib 1.2.13 h5eee18b_0
zstd 1.5.4 hc292b87_0
What CUDA version and GCC version should I be using?
Testing inside Ubuntu latest with CUda 11.5 and GCC 11.3
Getting the following.
`raceback (most recent call last):
File "/home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1808, in _run_ninja_build
subprocess.run(
File "/home/g/anaconda3/envs/e4s/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "scripts/face_swap.py", line 16, in
from src.pretrained.gpen.gpen_demo import init_gpen_pretrained_model, GPEN_demo
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/gpen_demo.py", line 15, in
from src.pretrained.gpen.face_enhancement import FaceEnhancement
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_enhancement.py", line 11, in
from src.pretrained.gpen.face_model.face_gan import FaceGAN
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/face_gan.py", line 14, in
from src.pretrained.gpen.face_model.gpen_model import FullGenerator, FullGenerator_SR
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/gpen_model.py", line 16, in
from src.pretrained.gpen.face_model.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/op/fused_act.py", line 13, in
fused = load(
File "/home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1202, in load
return jit_compile(
File "/home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1425, in jit_compile
write_ninja_file_and_build_library(
File "/home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1537, in write_ninja_file_and_build_library
run_ninja_build(
File "/home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1824, in run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'fused': [1/2] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/TH -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/THC -isystem /home/g/anaconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/TH -isystem /home/g/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/THC -isystem /home/g/anaconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /media/g/PCXtend/1TB/AI/e4s/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
ninja: build stopped: subcommand failed.
`
I tried running the code using the image in the sample, but encountered the following error. I am a beginner in this field, how can I solve it?
IndexError: The shape of the mask [1, 1, 1, 512, 512] at index 2 does not match the shape of the indexed tensor [1, 1, 512, 512] at index 2
/python3.8/site-packages/torch/cuda/init.py", line 190, in _lazy_init
torch._C._cuda_init()
RuntimeError: cuda runtime error (101) : invalid device ordinal at /pytorch/aten/src/THC/THCGeneral.cpp:47
(e4s) jack@jack-All-Series:~/e4s$ python scripts/face_swap.py --source=example/input/faceswap/source.jpg --target=example/input/faceswap/target.jpg
Traceback (most recent call last):
File "scripts/face_swap.py", line 15, in <module>
from src.pretrained.face_vid2vid.driven_demo import init_facevid2vid_pretrained_model, drive_source_demo
ModuleNotFoundError: No module named 'src'
(e4s) jack@jack-All-Series:~/e4s$
for context I didn't install any of the optional repos but have downloaded the pre-trained facevid2vid model
which script is used for pre-processing to get target_mask image?
I had to move the src folder inside scripts to fix paths
(e4s) C:\Users\user\e4s>python scripts/face_swap.py --source=example/input/faceswap/source.jpg --target=example/input/faceswap/target.jpg
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
File "scripts/face_swap.py", line 26, in
from src.models.networks import Net3
File "C:\Users\user\e4s\scripts\src\models\networks.py", line 8, in
from src.models.stylegan2.model import EqualLinear
File "C:\Users\user\e4s\scripts\src\models\stylegan2\model.py", line 11, in
from src.models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d, conv2d_gradfix
File "C:\Users\user\e4s\scripts\src\models\stylegan2\op_init_.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "C:\Users\user\e4s\scripts\src\models\stylegan2\op\fused_act.py", line 9, in
fused = load(
File "C:\Users\user\miniconda3\envs\e4s\lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load
return _jit_compile(
File "C:\Users\user\miniconda3\envs\e4s\lib\site-packages\torch\utils\cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\user\miniconda3\envs\e4s\lib\site-packages\torch\utils\cpp_extension.py", line 1611, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "C:\Users\user\miniconda3\envs\e4s\lib\site-packages\torch\utils\cpp_extension.py", line 2048, in _write_ninja_file_to_build_library
_write_ninja_file(
File "C:\Users\user\miniconda3\envs\e4s\lib\site-packages\torch\utils\cpp_extension.py", line 2188, in _write_ninja_file
cl_paths = subprocess.check_output(['where',
File "C:\Users\user\miniconda3\envs\e4s\lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\user\miniconda3\envs\e4s\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.
(e4s) C:\Users\user\e4s>conda list
blas 1.0 mkl
brotlipy 0.7.0 py38h2bbff1b_1003
ca-certificates 2023.01.10 haa95532_0
certifi 2023.5.7 py38haa95532_0
cffi 1.15.1 py38h2bbff1b_3
charset-normalizer 2.0.4 pyhd3eb1b0_0
colorama 0.4.6 pypi_0 pypi
contourpy 1.0.7 pypi_0 pypi
cryptography 39.0.1 py38h21b164f_0
cuda 12.1.1 0 nvidia
cuda-cccl 12.1.109 0 nvidia
cuda-command-line-tools 12.1.1 0 nvidia
cuda-compiler 12.1.1 0 nvidia
cuda-cudart 12.1.105 0 nvidia
cuda-cudart-dev 12.1.105 0 nvidia
cuda-cuobjdump 12.1.111 0 nvidia
cuda-cupti 12.1.105 0 nvidia
cuda-cuxxfilt 12.1.105 0 nvidia
cuda-demo-suite 12.1.105 0 nvidia
cuda-documentation 12.1.105 0 nvidia
cuda-libraries 12.1.1 0 nvidia
cuda-libraries-dev 12.1.1 0 nvidia
cuda-nsight-compute 12.1.1 0 nvidia
cuda-nvcc 12.1.105 0 nvidia
cuda-nvdisasm 12.1.105 0 nvidia
cuda-nvml-dev 12.1.105 0 nvidia
cuda-nvprof 12.1.105 0 nvidia
cuda-nvprune 12.1.105 0 nvidia
cuda-nvrtc 12.1.105 0 nvidia
cuda-nvrtc-dev 12.1.105 0 nvidia
cuda-nvtx 12.1.105 0 nvidia
cuda-nvvp 12.1.105 0 nvidia
cuda-opencl 12.1.105 0 nvidia
cuda-opencl-dev 12.1.105 0 nvidia
cuda-profiler-api 12.1.105 0 nvidia
cuda-runtime 12.1.1 0 nvidia
cuda-sanitizer-api 12.1.105 0 nvidia
cuda-toolkit 12.1.1 0 nvidia
cuda-tools 12.1.1 0 nvidia
cuda-visual-tools 12.1.1 0 nvidia
cudatoolkit 11.3.1 h59b6b97_2
cycler 0.11.0 pypi_0 pypi
filelock 3.9.0 py38haa95532_0
fonttools 4.39.4 pypi_0 pypi
freetype 2.12.1 ha860e81_0
giflib 5.2.1 h8cc25b3_3
idna 3.4 py38haa95532_0
importlib-resources 5.12.0 pypi_0 pypi
intel-openmp 2023.1.0 h59b6b97_46319
jinja2 3.1.2 py38haa95532_0
jpeg 9e h2bbff1b_1
kiwisolver 1.4.4 pypi_0 pypi
lerc 3.0 hd77b12b_0
libcublas 12.1.3.1 0 nvidia
libcublas-dev 12.1.3.1 0 nvidia
libcufft 11.0.2.54 0 nvidia
libcufft-dev 11.0.2.54 0 nvidia
libcurand 10.3.2.106 0 nvidia
libcurand-dev 10.3.2.106 0 nvidia
libcusolver 11.4.5.107 0 nvidia
libcusolver-dev 11.4.5.107 0 nvidia
libcusparse 12.1.0.106 0 nvidia
libcusparse-dev 12.1.0.106 0 nvidia
libdeflate 1.17 h2bbff1b_0
libffi 3.4.4 hd77b12b_0
libnpp 12.1.0.40 0 nvidia
libnpp-dev 12.1.0.40 0 nvidia
libnvjitlink 12.1.105 0 nvidia
libnvjitlink-dev 12.1.105 0 nvidia
libnvjpeg 12.2.0.2 0 nvidia
libnvjpeg-dev 12.2.0.2 0 nvidia
libnvvm-samples 12.1.105 0 nvidia
libpng 1.6.39 h8cc25b3_0
libtiff 4.5.0 h6c2663c_2
libuv 1.44.2 h2bbff1b_0
libwebp 1.2.4 hbc33d0d_1
libwebp-base 1.2.4 h2bbff1b_1
lz4-c 1.9.4 h2bbff1b_0
markupsafe 2.1.1 py38h2bbff1b_0
matplotlib 3.7.1 pypi_0 pypi
mkl 2023.1.0 h8bd8f75_46356
mkl-service 2.4.0 py38h2bbff1b_1
mkl_fft 1.3.6 py38hf11a4ad_1
mkl_random 1.2.2 py38hf11a4ad_1
mpmath 1.2.1 py38haa95532_0
networkx 2.8.4 py38haa95532_1
ninja 1.11.1 pypi_0 pypi
nsight-compute 2023.1.1.4 0 nvidia
numpy 1.24.3 py38h79a8e48_1
numpy-base 1.24.3 py38h8a87ada_1
openssl 1.1.1t h2bbff1b_0
pillow 9.4.0 py38hd77b12b_0
pip 23.0.1 py38haa95532_0
pycparser 2.21 pyhd3eb1b0_0
pyopenssl 23.0.0 py38haa95532_0
pyparsing 3.0.9 pypi_0 pypi
pysocks 1.7.1 py38haa95532_0
python 3.8.16 h6244533_3
python-dateutil 2.8.2 pypi_0 pypi
pytorch-mutex 1.0 cpu pytorch
pyyaml 6.0 pypi_0 pypi
requests 2.29.0 py38haa95532_0
setuptools 66.0.0 py38haa95532_0
sqlite 3.41.2 h2bbff1b_0
sympy 1.11.1 py38haa95532_0
tbb 2021.8.0 h59b6b97_0
tk 8.6.12 h2bbff1b_0
torch 2.0.1+cu118 pypi_0 pypi
torchvision 0.15.2 py38_cpu pytorch
tqdm 4.65.0 pypi_0 pypi
typing_extensions 4.5.0 py38haa95532_0
urllib3 1.26.15 py38haa95532_0
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wheel 0.38.4 py38haa95532_0
win_inet_pton 1.1.0 py38haa95532_0
xz 5.4.2 h8cc25b3_0
zipp 3.15.0 pypi_0 pypi
zlib 1.2.13 h8cc25b3_0
zstd 1.5.5 hd43e919_0
Thanks for the great work,
Are there any chance that we can get our hands on Interactive Face Beautification System as in poster presentation
ERROR LOG:
ple/input/faceswap/target.jpg
Traceback (most recent call last):
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1808, in _run_ninja_build
subprocess.run(
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "scripts/face_swap.py", line 16, in
from src.pretrained.gpen.gpen_demo import init_gpen_pretrained_model, GPEN_demo
File "/home/hou/code/e4s-main/src/pretrained/gpen/gpen_demo.py", line 15, in
from src.pretrained.gpen.face_enhancement import FaceEnhancement
File "/home/hou/code/e4s-main/src/pretrained/gpen/face_enhancement.py", line 11, in
from src.pretrained.gpen.face_model.face_gan import FaceGAN
File "/home/hou/code/e4s-main/src/pretrained/gpen/face_model/face_gan.py", line 14, in
from src.pretrained.gpen.face_model.gpen_model import FullGenerator, FullGenerator_SR
File "/home/hou/code/e4s-main/src/pretrained/gpen/face_model/gpen_model.py", line 16, in
from src.pretrained.gpen.face_model.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "/home/hou/code/e4s-main/src/pretrained/gpen/face_model/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "/home/hou/code/e4s-main/src/pretrained/gpen/face_model/op/fused_act.py", line 13, in
fused = load(
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1202, in load
return jit_compile(
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1425, in jit_compile
write_ninja_file_and_build_library(
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1537, in write_ninja_file_and_build_library
run_ninja_build(
File "/home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1824, in run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'fused': [1/2] /usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/TH -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/THC -isystem /home/hou/anaconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /home/hou/code/e4s-main/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
FAILED: fused_bias_act_kernel.cuda.o
/usr/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/TH -isystem /home/hou/anaconda3/envs/e4s/lib/python3.8/site-packages/torch/include/THC -isystem /home/hou/anaconda3/envs/e4s/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /home/hou/code/e4s-main/src/pretrained/gpen/face_model/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
ninja: build stopped: subcommand failed.
Running environment:
gcc version 10.4.0 (Ubuntu 10.4.0-4ubuntu1~22.04)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.