GithubHelp home page GithubHelp logo

cmwithblur's Introduction

Consistency Model with Blurring Noise ๐Ÿ˜‹

Final Project of Fundamentals of Generative Modeling at PKU 2023 fall.

Environment requirements ๐Ÿ”จ

To set the environment, just install the latest versions of

pillow torch torchvision pytorch-lightning diffusers torchmetrics lpips

Training ๐Ÿš‚

The main.py is used for training the model.

Unconditional training consistency model without blurring noise

python main.py --batch-size=80 --use-ema --task-name=blur_0_uncond

Unconditional training consistency model with blurring noise

python main.py --batch-size=80 --use-ema --sigma-blur-max=2 --task-name=blur_2_uncond

Conditional training consistency model with blurring noise

python main.py --batch-size=80 --use-ema --sigma-blur-max=2 --cond --task-name=blur_2_cond

Change the sigma of blurring noise

python main.py --batch-size=80 --use-ema --sigma-blur-max=3 --task-name=blur_2_uncond

Generation ๐Ÿ“ท

The main.py can also be used to generate samples.

Unconditional one step sampling

python main.py --eval --batch-size=1250 --use-ema --sigma-blur-max=2 --task-name=blur_2_uncond --load-checkpoint-path "ckpt/blur_2_uncond.ckpt" --sample-seed=1898 --sample-steps=1

Unconditional multi-step sampling

python main.py --eval --batch-size=1250 --use-ema --sigma-blur-max=2 --task-name=blur_2_uncond --load-checkpoint-path "ckpt/blur_2_uncond.ckpt" --sample-seed=1898 --sample-steps=5 --sample-with-blur --sample-blur-pow=1

Conditional multi-step sampling

python main.py --eval --batch-size=1250 --use-ema --sigma-blur-max=2 --cond --task-name=blur_2_cond --load-checkpoint-path "ckpt/blur_2_cond.ckpt" --sample-seed=1898 --sample-steps=5 --sample-with-blur --sample-blur-pow=1

Evaluation ๐Ÿ”

The evaluation.py is used for evaluating FID and IS of the generated images.

Evaluation the image folder "image_folder_dir"

python evaluation.py image_folder_dir

URL of the open-source code ๐Ÿ‘‹

https://github.com/junhsss/consistency-models

https://github.com/AaltoML/generative-inverse-heat-dissipation

cmwithblur's People

Contributors

cutenpc avatar

Watchers

 avatar

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.