nolan-dev / ganinterface Goto Github PK
View Code? Open in Web Editor NEWTool to interface with a StyleGAN model
License: Apache License 2.0
Tool to interface with a StyleGAN model
License: Apache License 2.0
Actually I want to convert pkl to pb file with all the weights, variables and the tensorflow inference frozen graph stored into it? Can you even write the script for the conversion of such file? Will be of great help.
The shell script docker run will convert all the parameters mentioned above? Some problems with permission denied with the shell script run.
@nolan-dev
Hi, firstly really thanks for your work.
I am finding a way to convert stylegan2.pkl model to .pb file. And I get succeed using your pkl_convert fuc, thanks!
The problem is that after I trying 2 model (ffhq-512-config-f.pkl and animeportraits-conf-f-512.pkl) and convert them to pb format,
then inference using .pb model.
But ffhq is good but anime is worse. I don't know why, Could you please tell me why about this ?
ffhq Result:
ffhq pkl model: https://drive.google.com/file/d/1Krc_m8Nj2PQXu9yBUnJ8-Na4mud_VCIj/view?usp=sharing
anime Result:
anime pkl model: https://drive.google.com/file/d/1exJwAJQT6BsdStyfuOkBTyZF4QeK5T61/view?usp=sharing
Part inference code:
input_tensor = graph.get_tensor_by_name('Gs/dlatent_avg:0')
output_tensor = graph.get_tensor_by_name('Gs/G_synthesis/output:0')
Hello! Could you update the readme with instructions for compiling the GANStudio executable? Or, would you be willing to drop your compiled exe in a release tab in this repo? I'd love to try this out but I'm at a loss for getting the projects compiled.
For additional context on what I've tried so far (I'm doing this on Windows 7 x64 with Visual Studio 2019, and I'm honestly not familiar with it at all...): I loaded and compiled each of the different solutions for TensorflowInterface, GanTools, and GanStudio in turn. Compiling GanStudio does create an executable but it throws an error. I figured out I needed a graph.pb and related StyleGAN checkpoint, so I put that in the bin folder alongside the executable. That seemed to work, but a new error indicated GanTools.dll was missing a required dll (Exception thrown: 'System.ArgumentException' in GanTools.dll
...I don't know how to get more verbose debug messages). I guessed it needed the TensorflowInterface.dll, which itself needed a Tensorflow.dll (I acquired one, unsure if it is the right version or if that matters at all), and I dropped all of those in the same folder as the GanStudio.exe. Anyway, that didn't work so I'm pretty much stuck. Hopefully I am just doing something foolish and there's a simple solution. I think I have the correct .NET framework version 4.7.2 and AVX enabled, if that matters.
Hi,
How to convert pkl to pb on windows?
Thank you!
Thanks for the great work.
StyleGAN3 seems to work pretty well, do you have any plans on training this on StyleGAN3?
I generate an image at 1024px and it's so large that the contents of the window with all the controls and buttons are pushed to the side, to the point of being outside the window and inaccessible. There's no horizontal scroll, there's no zoom out option that I can see, there's no way to pop out the image or hide it, I genuinely can't use the program because of this.
a. Is this compatible with 1024x1024 models like these:
https://github.com/a312863063/generators-with-stylegan2
?
(It says it's StyleGAN2 though)
b. Are there hardcoded parts in the (C# and the dll) codes?
c. I saved a *.pkl model to *.pb on GoogleColab with this script:
############
import pickle
import dnnlib.tflib as tflib
import tensorflow as tf
EXPORT_PATH = "savemodel2"
tflib.init_tf()
_G, _D, Gs = pickle.load(open("xxx.pkl", "rb"))
sess = tf.get_default_session()
tf.saved_model.simple_save(
sess,
EXPORT_PATH,
inputs={t.name:t for t in Gs.input_templates},
outputs={t.name:t for t in Gs.output_templates})
############
(from http://tachibana.ai/2019/06/15/Portal-Log-One.html)
It generates a pb and a "Variables" folder (Weights not embed inside pb?), Can this kind of saved binary be loaded?
=============
Also I found that replacing tensorflow.dll with Topaz ones from
https://d2xkriaa67cpt4.cloudfront.net/packages/win/topazmask/com.topazlabs.topazmask.libs3rdparty/1.0.7topazmasklibs3rdparty.7z
can make this use cudnn:
Any of you who has interest can try yourself. This one
https://d2xkriaa67cpt4.cloudfront.net/packages/win/topazstudio2/com.topazlabs.topazstudio2.libs3rdparty/2.1.1topazstudio2libs3rdparty.7z
(TF 1.14, no cudnn) works too.
Hello, I got an error when trying to launch the interface or using some of the features (for example, I can't import images):
System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Single.Parse(String s)
at System.Array.ConvertAll[TInput,TOutput](TInput[] array, Converter`2 converter)
at GanimeStudio.LatentManipulator.ReadAverageLatentFromCsv(String csvPath)
at GanimeStudio.GanimeStudio.Form1_Load(Object sender, EventArgs el)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I have .NET framework 4.7 installed (and others versions as well, perhaps it's conflicting).
Loose plan:
Can you add an option to train a model on my own dataset ?
I want to make a morphing cat gif.
I have downloaded the stylegan2 cat pkl, as well as the compiled version of GANInterface from the anime tutorial, hoping to instead generate a morphing cat animation gif from images and their interpolations generated from the cat pkl.
How do I do this? Is their an option to load other stylegan2 pkl from the compiled ui? If there is no pkl loading option, is there a way to convert pkl to latent space for loading into GANInterface? (I ask the last question because I notice changing name of "data_b75d22410203401232872f3627826b4d" folder leads to an error, and I suspect this particular error concerns some saved pkl in some way.
Just wanted to tell that I appreciate what you've done with StyleGAN and it's really great.
I was wondering if you could do this with Generated (or given) Faces and not only with Anime faces?!
Thanks again for your awesome work!
Hi, it looks like a really useful tool. Is there any implementation on ubuntu?
invalid
I think it would be really useful if there was an option to make 256x512 resolution anime artworks, as they can be used in card games, visual novels, RPGs, and many other gaming and artistic mediums, removing a lot of the existing barriers for creativity in those fields.
Thanks again for making the future possible! This is one of the AI I'm most excited for its potential.
Hello,
I am getting an error while trying to convert a stylegan pytorch ada model (.pkl) to a pb using your instructions, I get this error:
Loading networks from "../file.pkl"... Traceback (most recent call last): File "run_conversion.py", line 70, in <module> main() File "run_conversion.py", line 65, in main save_weights(args.network) File "run_conversion.py", line 24, in save_weights _G, _D, Gs = pretrained_networks.load_networks(network_pkl) File "/tmp/work/stylegan2/pretrained_networks.py", line 76, in load_networks G, D, Gs = pickle.load(stream, encoding='latin1') ModuleNotFoundError: No module named 'torch_utils'
Is there any way to solve this ?
I have a RTX 2070, how can I use tensorflow-gpu
I was looking into porting this to something like pytorch, however in order to do so (efficiently) I would need the non frozen models (the checkpoints, meta, etc). I was wondering if you'd be willing to upload said data somewhere :)
Thanks
really appreciate your nice work!
But I have a small trouble. you have found the stable combination of feature map to edit anime faces.
but when I edit the non-anime face images on your v0.2.0-alpha using ffhq.pb . I can't find a stable combination of feature maps to edit specified area of those face photos,such as mouth-smiling.
How to get those combination?
looking forward to your reply?Thanks
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.