Code Monkey home page Code Monkey logo

dldm's Introduction

Disentangled Latent Diffusion Model (DLDM)

This repo contains Pytorch implemented model definitions, pre-trained weights and training/sampling code for DLDMs.

Installation guide

  1. git clone this repo
  2. Install the pkgs and activate envorionment
$ git clone [email protected]:Yoonho-Na/DLDM.git
$ cd DLDM
$ conda env create -f environment.yaml
$ conda activate dldm

Download pre-trained model

We provide pretrained weights.

$ python scripts/pretrained_dldm.py

Sampling

$ python sample.py

Custom dataset

  1. put your files (.jpg, .npy, .png, ...) in a folder custom_folder
  2. create 2 text files a xx_train.txt and xx_valid.txt that point to the files in your training and test set respectively
    find $(pwd)/custom_folder/train -name "*.npy" > xx_train.txt
    find $(pwd)/custom_folder/valid -name "*.npy" > xx_valid.txt
${pwd}/custom_folder/train/
├── class1
│   ├── filename1.npy
│   ├── filename2.npy
│   ├── ...
├── class2
│   ├── filename1.npy
│   ├── filename2.npy
│   ├── ...
├── ...

${pwd}/custom_folder/valid/
├── class1
│   ├── filename1.npy
│   ├── filename2.npy
│   ├── ...
├── class2
│   ├── filename1.npy
│   ├── filename2.npy
│   ├── ...
├── ...
  1. adapt configs/custom_DAE.yaml to point to these 2 files
  2. run python main.py --base configs/custom_DAE.yaml -t True --gpus 0,1 to train on two GPUs. Use --gpus 0, (with a trailing comma) to train on a single GPU.

Generated dataset

dldm's People

Contributors

yoonho-na avatar

Stargazers

Won Dong Kyu avatar Tiago Comassetto Fróes 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.