vinairesearch / hyperinverter Goto Github PK
View Code? Open in Web Editor NEWHyperInverter: Improving StyleGAN Inversion via Hypernetwork (CVPR 2022)
Home Page: https://di-mi-ta.github.io/HyperInverter/
License: Apache License 2.0
HyperInverter: Improving StyleGAN Inversion via Hypernetwork (CVPR 2022)
Home Page: https://di-mi-ta.github.io/HyperInverter/
License: Apache License 2.0
Thanks for your great project. When I train the second stage, I set batchsize=2, but it comes out of memory.
Hi, I am getting the following error when try to run the inference script, I did complete all the installation steps without an error
Traceback (most recent call last):
File "scripts/inference.py", line 91, in <module>
run()
File "scripts/inference.py", line 34, in run
net = HyperInverter(opts)
File "./models/hyper_inverter.py", line 58, in __init__
self.load_weights()
File "./models/hyper_inverter.py", line 99, in load_weights
ckpt = pickle.load(f)
ModuleNotFoundError: No module named 'dnnlib.tflib'
how to get these flie?
Please, upload some of the face test images shown in the paper so I can validate and evaluate my inference results with those images with the results shown on Hyperinverter papers and that they are comparable.
Thanks.
Trying to run inference on Windows:
Installed all requirements without any error, but I do get one when try to run inference:
(HyperInverter) H:\AI\HyperInverter>python scripts/inference.py --exp_dir=./results --checkpoint_path=./pretrained_models/hyper_inverter_e4e_ffhq_encode_large.pt --data_path=./data --batch_size= 4 --workers=4
C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py:287: UserWarning: Error checking compiler version for cl: [WinError 2] Impossibile trovare il file specificato
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
INFORMAZIONI: impossibile trovare file corrispondenti ai
criteri di ricerca indicati.
Traceback (most recent call last):
File "scripts/inference.py", line 14, in <module>
from models.hyper_inverter import HyperInverter # noqa: E402
File ".\models\hyper_inverter.py", line 10, in <module>
from models.encoders import fpn_encoders
File ".\models\encoders\fpn_encoders.py", line 5, in <module>
from models.stylegan2.model import EqualLinear
File ".\models\stylegan2\model.py", line 5, in <module>
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File ".\models\stylegan2\op\__init__.py", line 1, in <module>
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File ".\models\stylegan2\op\fused_act.py", line 14, in <module>
os.path.join(module_path, "fused_bias_act_kernel.cu"),
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 997, in load
keep_intermediates=keep_intermediates)
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1202, in _jit_compile
with_cuda=with_cuda)
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1293, in _write_ninja_file_and_build_library
with_cuda=with_cuda)
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1689, in _write_ninja_file_to_build_library
with_cuda=with_cuda)
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\site-packages\torch\utils\cpp_extension.py", line 1791, in _write_ninja_file
'cl']).decode().split('\r\n')
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Users\GIN\.conda\envs\HyperInverter\lib\subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.
THank you for your great work.
Is to possible to convert image to different domain and not using latent directions to change latect codes?
For example, pSp can generate a front-facing face from a given input image and generate photo-realistic face images from ambiguous sketch images
I am wondering HyperInverter can do the samething?
If it is possilbe, should I modeified your codes? or I just need to change data path?
Looking forward to your reply.
Hi, Thank you for the great tutorial about GAN invention, I am new to this topic.
I just checked the inversion and rebuilding of a different image of size 256x256 from the ffhq dataset. But it stops at 0.5 mse loss. What may be the reason for that and How can I avoid it and make it generate like the given INVERTME.png image.
Thanks in advance
Hi, sorry to bother you again. I find some code in class WeightRegressor like:
out = torch.matmul(out, self.w1) + self.b1
out = out.view(bs, self.in_channels, self.hidden_dim)
out = torch.matmul(out, self.w2) + self.b2
kernel = out.view(bs, self.out_channels, self.in_channels, self.kernel_size, self.kernel_size) # like bz, 512, 512, 3, 3
why not use linear layer, like
w1 = nn.Linear(128, 65536)
w2 = nn.Linear(65536, 2359296)
out = w1(out)
out = w2(out)
kernel = out.view(bs, self.out_channels, self.in_channels, self.kernel_size, self.kernel_size)
is there any way to load the StyleGAN model without tf 1.x ?
really cool @VinAIResearch
hope you guys will add a colab notebook were we could test it on colab gpu.
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.