GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tim-kuechler/SemanticSynthesisForScoreBasedModels: Code for my Bachelor thesis on Semantic Image Synthesis with Score-Based Generative Models

This repository was archived by the owner on May 7, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
configs
configs
 
 
datasets
datasets
 
 
model
model
 
 
op
op
 
 
semantic_synthesis
semantic_synthesis
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
losses.py
losses.py
 
 
main.py
main.py
 
 
run.py
run.py
 
 
sampling.py
sampling.py
 
 
sde_lib.py
sde_lib.py
 
 
setup.py
setup.py
 
 

Repository files navigation

Semantic Image Synthesis with Score-Based Generative Models

This repo contains the implementation for my Bachelor thesis Semantic Image Synthesis with Score-Based Generative Models

by Tim Küchler

Please find my thesis (english) following this link: https://github.com/TimK1998/Bachelor-Thesis/blob/main/Bachelorarbeit.pdf


Note: This README is work in progress!

How to run the code

Dependencies

First install PyTorch 1.8, then run setup.py with the command

python setup.py install

Usage

Train or sample from models trough main.py:

main.py:
  workdir: Working directory
  config: Name of the config
  mode: <train|sample>: Running mode: train or sample
  --sample_mode: Sampling mode
  • workdir is the path where all checkpoints and samples should be saved. The path you specify gets appended to ./output so you might want to specify the working directory with only one word.
  • config is the name of the config to use. Refer to configs/ve for examples.
  • mode is either "train" or "sample". When set to train is starts the training pipeline for a new model, or continues training if workdir already contains a valid checkpoint. When set to sample it loads the latest checkpoint in ./output/workdir/checkpoints and starts sampling with the sampling mode specified.
  • sample_mode: The mode for the sampling procedure. Already implemented are uncond for unconditional samples and cond for conditional samples. Feel free to add modes by implementing them in the sample(...) function in run.py.

Train

For example to train a Score-Based Generative Model on the Cityscapes dataset run

python main.py cityscapes_workdir cityscapes256_ve train

Sample

For example to conditinally sample from a trained Score-Based Generative Model on the Cityscapes dataset run

python main.py cityscapes_workdir cityscapes256_ve sample cond

References

If you find the code useful for your research, please consider citing

@unpublished{kuechler_sem_synth_score_based,
    author="Tim Küchler",
    title={Semantic Image Synthesis with Score-Based Generative Models},
    year={2021}
    howpublished={\url{https://github.com/TimK1998/SemanticSynthesisForScoreBasedModels}}
}

This work is built upon previous papers which might also interest you:

  • Yang Song and Jascha Sohl-Dickstein and Diederik P Kingma and Abhishek Kumar and Stefano Ermon and Ben Poole. "Score-Based Generative Modeling through Stochastic Differential Equations." International Conference on Learning Representations. 2021.
  • Yang Song and Stefano Ermon. "Generative Modeling by Estimating Gradients of the Data Distribution." Proceedings of the 33rd Annual Conference on Neural Information Processing Systems. 2019.
  • Yang Song and Stefano Ermon. "Improved techniques for training score-based generative models." Proceedings of the 34th Annual Conference on Neural Information Processing Systems. 2020.

The code heavily borrows from https://github.com/yang-song/score_sde_pytorch

License

This implementation is licensed under the Apache License 2.0.

About

Code for my Bachelor thesis on Semantic Image Synthesis with Score-Based Generative Models

Topics

controllable-generationpytorchscore-based-generative-modelingscore-based-generative-modelsscore-based-modelsscore-matchingsemantic-image-synthesissemantic-synthesis

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.