Giter VIP home page Giter VIP logo

stylegan-jt's Introduction

stylegan-jt

Stylegan Implemented by jittor in Computer Graphics(Fall 2021), Tsinghua Univ.

Train the model

I trained the stylegan model on a standard symbol dataset and FFHQ dataset. You can get these two dataset using the following instructions.

wget https://drive.google.com/file/d/1D8gV6sMqpgGc3dW2V9ihMw024adAXQlb/view?usp=sharing -O data/color_symbol_7k.zip 
#standard symbol dataset
wget https://drive.google.com/file/d/1bF2HDytK8W2NGiTip8ne_xEeViW3NNBy/view?usp=sharing -O data/FFHQ_data.zip 
#FFHQ dataset

Then you can unzip the dataset and preprocess them using the following instructions to get data of different resolutions.

Don't forget to make necessary modifications in sh/preprocess.sh and sh/preprocess_face.sh to adjust to your data path.

bash ./sh/preprocess.sh #standard symbol dataset
bash ./sh/preprocess_face.sh #FFHQ dataset

After this you can train your own stylegan model on these two dataset using the following instructions.

bash ./sh/train.sh #standard symbol dataset
bash ./sh/train_face.sh #FFHQ dataset

Test the model

After you have trained the stylegan model, you can run the following instructions to load the model and generate pictures by latent space interpolations.

bash ./sh/test.sh #standard symbol dataset
bash ./sh/test_face.sh #FFHQ dataset

Or you can just download my pretrained model and run the test instructions.

wget https://drive.google.com/file/d/1BnELx6p_b18m5Tv0d1OfI2lOSkyRALxK/view?usp=sharing -O ./checkpoints/symbol_80w_ckpt/800000.model
#standard symbol dataset
wget https://drive.google.com/file/d/1RxbLH3ErJP06glT1IJTIYSxeT5Kvu5b3/view?usp=sharing -O ./checkpoints/face_80w_ckpt/800000.model 
#FFHQ dataset

Here we show some latent space interpolations results on these two dataset. The first row and column are two groups of interpolated pictures and the other are interpolation results.

And we also generate some latent space interpolations results from a temporal view in order to generate a demo video, these pictures will be saved in output/interpolation_80_80w and output/face_interpolation_80_80w. The following are two samples.

Demo

After generate latent space interpolations results and save them, you can just run the following instructions to generate videos to show the training process and interpolation process.

Here we also show some demo videos.

Symbol training process

Symbol interpolation process

FFHQ training process

FFHQ interpolation process

Reference

License

The files written by contributors in this project use MIT LICENSE open source without special instructions. This means that you may use, copy, modify, publish, and use the Project for commercial purposes at will, provided that this Open Source License must be included in all copies based on the Project and its derivatives.

The copyright for the remainder belongs to the respective authors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.