k-l-lambda / stylegan-web Goto Github PK
View Code? Open in Web Editor NEWA web porting for NVlabs' StyleGAN.
A web porting for NVlabs' StyleGAN.
Some one creates a keanu reaves latent representation - we hook into this list
{
"latentRepresentations": [
{
"title": "Keanu",
"file": "Keanu.npy",
"thumb": "https://github.com/name/Keanu.png",
"url": "https://github.com/name/Keanu.npy"
},
}
@app.route('/generate', methods=['GET'])
Hi,
When I run the project locally, clipboard functionality works fine. However, when I try to run the project on a server (for example, AWS EC2 instance), copy to latent code buttons and hash copy-paste in merger page do not work because of this issue: navigator.clipboard is undefined
What I've learned is clipboard doesn't work with unsecured applications. So, it's necessary to run flask over HTTPS if you would like to use clipboard functionalities. If you think that this functionality is not necessary, at least it might be good to add a note in README.md.
https://github.com/battleaxedotco/brutalism
We maybe able to drop this into the main view - and achieve some organization.
eg. might make sense to collapse the maths stuff into one of the tabs at bottom.
Another one for the 512 vectors.
Another one for the latent directions
Another one for ....
Given an existing star / celebrity load / save
this code could be put into a pipeline / for subparsers
maybe it may have to look like photoshop layers (will raise another ticket)
def augmentation(args):
os.makedirs(args.dst_dir+'/augmentation', exist_ok=True)
print('Loading networks from "{}"...'.format(args.network_pkl))
tflib.init_tf()
with open(args.network_pkl, "rb") as f:
generator_network, discriminator_network, Gs_network = pickle.load(f)
Gs_syn_kwargs = dnnlib.EasyDict()
Gs_syn_kwargs.output_transform = dict(func=tflib.convert_images_to_uint8, nchw_to_nhwc=True)
Gs_syn_kwargs.randomize_noise = False
Gs_syn_kwargs.minibatch_size = 1
pic = np.load(args.src_dir)
for i in tqdm(range(int(args.num))):
scale1 = random.uniform(-float(args.smile_range), float(args.smile_range))
scale2 = random.uniform(-float(args.age_range), float(args.age_range))
scale3 = random.uniform(-float(args.angleh_range), float(args.angleh_range))
scale4 = random.uniform(-float(args.anglep_range), float(args.anglep_range))
scale5 = random.uniform(-float(args.angry_range), float(args.angry_range))
scale6 = random.uniform(-float(args.sad_range), float(args.sad_range))
scale7 = random.uniform(-float(args.eye_range), float(args.eye_range))
latent_vector = pic[np.newaxis, :]
new_latent_vector = latent_vector.copy()
new_latent_vector[0][:8] = (latent_vector[0] + scale1 * smile_drt + scale2 * age_drt
+ scale3 * angleh_drt + scale4 * anglep_drt
+ scale5 * angry_drt + scale6 * sad_drt
+ scale7 * eye_drt)[:8]
img = Gs_network.components.synthesis.run(new_latent_vector, **Gs_syn_kwargs)
img = PIL.Image.fromarray(img[0])
img.save('{}/augmentation/{}.png'.format(args.dst_dir, str(i).zfill(4)))
This is an amazing work you are doing here!
I've forked your code and thought of adding Docker and Docker-compose for making it way more easy to start.
See https://github.com/valentinvieriu/stylegan-web
Are you interested in having this approach in you repo?
So I've been trying out different stylegan repos - and I'm imaging a fusion of two.
Basically the guts of this repo
GreenLimeSia/GenEdi#3
While it is in pytorch - I think it would be great to surface these in side bar as in the 512 vectors currently in another tab.
Also checkout artbreeder
https://www.artbreeder.com/
it has some simple controls to switch up / infuse latent vectors.
Side note - the nvidia labs are switching over to pytorch -
NVlabs/stylegan2-ada#32 (comment)
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
Hello,
First of all, I'd like to thank you for this amazing repository! My friend and I are examining it in this fork: https://github.com/aiksir/stylegan-web
When I run this command to build the frontend: npm run-script build
, I get the following error:
(forked-stylegan-web) baris@bariss-MacBook-Pro forked-stylegan-web % npm run-script build
> [email protected] build /Users/baris/Documents/PycharmProjects/forked-stylegan-web
> rollup -c rollup.config.js
./app/index.js → dist/index.bundle.js...
created dist/index.bundle.js in 880ms
./app/projector.js → dist/projector.bundle.js...
[!] Error: 'import' and 'export' may only appear at the top level
node_modules/face-api.js/build/es6/env/isNodejs.js (1:0)
1: export function isNodejs() {
^
2: return typeof global === 'object'
3: && typeof require === 'function'
Error: 'import' and 'export' may only appear at the top level
at error (/Users/baris/Documents/PycharmProjects/forked-stylegan-web/node_modules/rollup/dist/shared/node-entry.js:5400:30)
at Module.error (/Users/baris/Documents/PycharmProjects/forked-stylegan-web/node_modules/rollup/dist/shared/node-entry.js:9824:16)
at tryParse (/Users/baris/Documents/PycharmProjects/forked-stylegan-web/node_modules/rollup/dist/shared/node-entry.js:9717:23)
at Module.setSource (/Users/baris/Documents/PycharmProjects/forked-stylegan-web/node_modules/rollup/dist/shared/node-entry.js:10080:33)
at /Users/baris/Documents/PycharmProjects/forked-stylegan-web/node_modules/rollup/dist/shared/node-entry.js:12366:20
at async Promise.all (index 4)
at async Promise.all (index 6)
at async Promise.all (index 2)
at async Promise.all (index 0)
at async Promise.all (index 1)
at async Promise.all (index 0)
at async Promise.all (index 0)
at async Promise.all (index 0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `rollup -c rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/baris/.npm/_logs/2020-10-15T10_02_32_356Z-debug.log
I have made a quick search on the internet but I couldn't figure it out because I'm not much familiar with Vue. Are you aware of this issue?
It would be very useful to have the ability to export the intermediate "Merge" images into a gif.
Also as a major feature suggestion:
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.