Giter VIP home page Giter VIP logo

stylecinegan's Introduction

StyleCineGAN: Landscape Cinemagraph Generation using a Pre-trained StyleGAN (CVPR 2024)

This is the official PyTorch implementation of "StyleCineGAN: Landscape Cinemagraph Generation using a Pre-trained StyleGAN" (CVPR2024).

teaser

Abstract: We propose a method that can generate cinemagraphs automatically from a still landscape image using a pre-trained StyleGAN. Inspired by the success of recent unconditional video generation, we leverage a powerful pre-trained image generator to synthesize high-quality cinemagraphs. Unlike previous approaches that mainly utilize the latent space of a pre-trained StyleGAN, our approach utilizes its deep feature space for both GAN inversion and cinemagraph generation. Specifically, we propose multi-scale deep feature warping (MSDFW), which warps the intermediate features of a pre-trained StyleGAN at different resolutions. By using MSDFW, the generated cinemagraphs are of high resolution and exhibit plausible looping animation. We demonstrate the superiority of our method through user studies and quantitative comparisons with state-of-the-art cinemagraph generation methods and a video generation method that uses a pre-trained StyleGAN.


Getting Started

Environment Setup

We recommend to use Docker. Use seokg1023/vml-pytorch:vessl for the docker image.

docker pull seokg1023/vml-pytorch:vessl

All dependencies for the environment are provided in requirements.txt.

pip install -r requirements.txt

Download Checkpoints

We provide pre-trained checkpoints of StyleGAN2 and encoder networks here.
Download and unzip the checkpoint files and place them in ./pretrained_models.


Inference

We provide an inference code for the proposed MSDFW method following the GAN inversion process. Run main.py as the following example:

python main.py --img_path ./samples/0002268 --save_dir ./results

To test the method with your own data, please place the data as below:

$IMG_PATH$
    └── $FILE_NAME$
         ├── $FILE_NAME$.png
         ├── $FILE_NAME$_mask.png
         └── $FILE_NAME$_motion.npy

Acknowledgement

The code for this project was build using the codebase of StyleGAN2, pix2pixHD, FeatureStyleEncoder, DatasetGAN. The symmetric-splatting code was built on top of softmax-splatting. We are very thankful to the authors of the corresponding works for releasing their code.


Citation

@InProceedings{Choi_2024_CVPR,
    author    = {Choi, Jongwoo and Seo, Kwanggyoon and Ashtari, Amirsaman and Noh, Junyong},
    title     = {StyleCineGAN: Landscape Cinemagraph Generation using a Pre-trained StyleGAN},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2024},
    pages     = {7872-7881}
}

stylecinegan's People

Contributors

jeolpyeoni avatar

Stargazers

Albert Negura avatar あなむし avatar  avatar  avatar Luck avatar Yingshu CHEN avatar Xuechao Zou avatar hchen avatar Abate De Mey avatar Soyeon Yoon avatar MTamam avatar Edward Seo avatar  avatar Erilatley avatar Defe avatar  avatar  avatar Abdullah Mahmood avatar liurf avatar  avatar Soyeong Yang avatar CL_Kim avatar Junichi Shimizu avatar Ameer Azam avatar Youngseo Kim avatar kwan avatar aryan avatar auBer_ avatar  avatar  avatar Daniel T. Schøn avatar UglyStupidHonest avatar shong avatar Inferencer avatar  avatar

Watchers

 avatar Inferencer avatar

stylecinegan's Issues

Motion npy

How can I create a motion npy file for my own image?

Cannot use docker image

Hello,

First of all amazing work,

I have trouble using the docker image, since I'm facing a circular opencv import and not being able to compile with Ninja. Could you perhaps explain explicitly how you run things when you are inside docker?

BR

How to train?

Hello, I wanna to know how to train and which dataset used?

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.