Official PyTorch implementation of BlobGAN: Spatially Disentangled Scene Representations

Overview

BlobGAN: Spatially Disentangled Scene Representations
Official PyTorch Implementation

Paper | Project Page | Video | Interactive Demo Open in Colab

BlobGAN.mp4

This repository contains:

  • 🚂 Pre-trained BlobGAN models on three datasets: bedrooms, conference rooms, and a combination of kitchens, living rooms, and dining rooms
  • 💻 Code based on PyTorch Lightning and Hydra 🐍 which fully supports CPU, single GPU, or multi GPU/node training and inference

We also provide an 📓 interactive demo notebook to help get started using our model. Download this notebook and run it on your own Python environment, or test it out on Colab. You can:

  • 🖌️ ️ Generate and edit realistic images with an interactive UI
  • 📹 Create animated videos showing off your edited scenes

And, coming soon!

  • 📸 Upload your own image and convert it into blobs!
  • 🧬 Programmatically modify images and reproduce results from our paper

Setup

Run the commands below one at a time to download the latest version of the BlobGAN code, create a Conda environment, and install necessary packages and utilities.

git clone https://github.com/dave-epstein/blobgan.git
mkdir -p blobgan/logs/wandb
conda create -n blobgan python=3.9
conda activate blobgan
conda install pytorch=1.11.0 torchvision=0.12.0 torchaudio cudatoolkit=11.3 -c pytorch
conda install cudatoolkit-dev=11.3 -c conda-forge
pip install tqdm==4.64.0 hydra-core==1.1.2 omegaconf==2.1.2 clean-fid==0.1.23 wandb==0.12.11 ipdb==0.13.9 lpips==0.1.4 einops==0.4.1 inputimeout==1.0.4 pytorch-lightning==1.5.10 matplotlib==3.5.2 mpl_interactions[jupyter]==0.21.0
wget -q --show-progress https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
sudo unzip -q ninja-linux.zip -d /usr/local/bin/
sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force

Running pretrained models

See scripts/load_model.py for an example of how to load a pre-trained model (using the provided load_model function, which can be called from elsewhere) and generate images with it. You can also run the file from the command line to generate images and save them to disk. For example:

python scripts/load_model.py --model_name bed --dl_dir models --save_dir out --n_imgs 32 --save_blobs --label_blobs

See the command's help for more details and options: scripts/load_model.py --help

Training your own model

Before training your model, you'll need to modify src/configs/experiments/local.yaml to include your WandB information and machine-specific configuration (such as path to data -- dataset.path or dataset.basepath -- and number of GPUs trainer.gpus). To turn off logging entirely, pass logger=false, or to only log to disk but not write to server, pass wandb.offline=true. Our code currently only supports WandB logging.

Here's an example command which will train a model on LSUN bedrooms. We list the configuration modules to load for this experiment (blobgan, local, jitter) and then specify any other options as we desire. For example, if we wanted to train a model without jitter, we could just remove that module from the experiments array.

python src/run.py +experiment=[blobgan,local,jitter] wandb.name='10-blob BlobGAN on bedrooms'

In some shells, you may need to add extra quotes around some of these options to prevent them from being parsed immediately on the command line.

Train on the LSUN category of your choice by passing in dataset.category, e.g. dataset.category=church. Tackle multiple categories at once with dataset=multilsun and dataset.categories=[kitchen,bedroom].

You can also train on any collection of images by selecting dataset=imagefolder and passing in the path. The code expects at least a subfolder named train and optional subfolders named validate and test. The below command also illustrates how to set arbitrary options using Hydra syntax, such as turning off FID logging or changing dataloader batch size:

python src/run.py +experiment=[blobgan,local,jitter] wandb.name='20-blob BlobGAN on Places' dataset.dataloader.batch_size=24 +model.log_fid_every_epoch=false dataset=imagefolder +dataset.path=/path/to/places/ model.n_features=20

Other parameters of interest are likely trainer.log_every_n_steps and model.log_images_every_n_steps which control frequency of logging scalars and images, and checkpoint.every_n_train_steps and checkpoint.save_top_k which dictate checkpoint saving frequency and decide how many most recent checkpoints to keep (-1 means keep everything).

Citation

If our code or models aided your research, please cite our paper:

@misc{epstein2022blobgan,
      title={BlobGAN: Spatially Disentangled Scene Representations},
      author={Dave Epstein and Taesung Park and Richard Zhang and Eli Shechtman and Alexei A. Efros},
      year={2022},
      eprint={2205.02837},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}		

Code acknowledgments

This repository is built on top of rosinality's excellent PyTorch re-implementation of StyleGAN2 and Bill Peebles' GANgealing codebase.

Comments
  • Getting

    Getting "RuntimeError: CUDA error: out of memory" when trying to train on multiple GPUs

    Hi,

    I'm getting this error when trying to train my own model on multiple GPUs.

    This is my command: python src/run.py +experiment=[blobgan,local,jitter] wandb.name='10-blob BlobGAN on bedrooms

    This is my local.yaml:

    dataset:
      path: /home/yimingsu/blobgan/resizedout # Change to your path
      resolution: 128
      #dataloader:
        #batch_size: 24
    trainer:
      gpus: 4  # Change to your number of GPUs
    wandb:  # Fill in your settings
      group:  Group
      project: Blobgan investigation
      entity: yimingsu
    model:
      #layout_net:
        #feature_dim: 256
      #generator:
        #override_c_in: 256
      #dim: 256
      fid_stats_name: mitbedroom # this is my custom dataset.
    

    This is the error log:

    Error executing job with overrides: ['+experiment=[blobgan,local,jitter]', 'wandb.name=10-blob BlobGAN on bedrooms']
    Traceback (most recent call last):
      File "/home/yimingsu/blobgan/src/run.py", line 81, in run
        trainer.fit(model, datamodule=datamodule)
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
        self._call_and_handle_interrupt(
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
        return trainer_fn(*args, **kwargs)
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
        self._run(model, ckpt_path=ckpt_path)
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1138, in _run
        self._call_setup_hook()  # allow user to setup lightning_module in accelerator environment
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1435, in _call_setup_hook
        self.training_type_plugin.barrier("pre_setup")
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/pytorch_lightning/plugins/training_type/ddp.py", line 403, in barrier
        torch.distributed.barrier(device_ids=self.determine_ddp_device_ids())
      File "/home/yimingsu/blobganenv/lib/python3.9/site-packages/torch/distributed/distributed_c10d.py", line 2784, in barrier
        work = default_pg.barrier(opts=opts)
    RuntimeError: CUDA error: out of memory
    CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
    For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
    
    Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
    

    I'm training on 4 RTX 2080 Ti so I don't think the memory is the actual issue.

    Any help would be appreciated!

    opened by yimingsu01 5
  • Cannot reproduce a layout

    Cannot reproduce a layout

    Hi,

    I cannot reproduce with the same layout

    layout, img = model.gen(z, ret_layout=True)
    layout, img = model.gen(layout=layout, ret_layout=True)
    

    https://github.com/dave-epstein/blobgan/blob/c527f1c27447dffe3cf4cf3901571a83ce59f1fe/src/models/blobgan.py#L303

    https://github.com/dave-epstein/blobgan/blob/c527f1c27447dffe3cf4cf3901571a83ce59f1fe/src/models/blobgan.py#L323

    I am wondering the basis computation is wrong here, which you will get a tensor with shape BxCx2x0: https://github.com/dave-epstein/blobgan/blob/c527f1c27447dffe3cf4cf3901571a83ce59f1fe/src/models/blobgan.py#L327

    opened by shijianjian 4
  • Getting Error of

    Getting Error of "No Image" When Trying to Train on Custom Dataset

    Hi. I was trying to replicate the experiment with my custom dataset of bedrooms. I've modified my local.yaml and set the basepath to the image folder, where it contains train, test, and validate. I'm sure that they all contain images. But when I execute this:

    python src/run.py +experiment=[blobgan,local,jitter] wandb.name='10-blob BlobGAN on bedrooms'
    

    It gives this error:

    AssertionError: Cannot compute FID without name of statistics file to use.
    

    After scrolling up, I found these errors:

    Warning: no images found in /home/PythonProjects/blobgan/resizedout/train. Using empty dataset for split train. Perhaps you set `dataset.path` incorrectly?
    Warning: no images found in /home/PythonProjects/blobgan/resizedout/validate. Using empty dataset for split validate. Perhaps you set `dataset.path` incorrectly?
    Warning: no images found in /home/PythonProjects/blobgan/resizedout/test. Using empty dataset for split test. Perhaps you set `dataset.path` incorrectly?
    

    This is the entire error log:

    resume:
      id: null
      step: null
      epoch: null
      last: true
      best: false
      clobber_hparams: false
      project: Blobgan investigation
      log_dir: ./logs
      model_only: false
    logger: wandb
    wandb:
      save_code: true
      offline: false
      log_dir: ./logs
      id: null
      name: 10-blob BlobGAN on bedrooms
      group: XXX Group
      project: Blobgan investigation
      entity: yimingsu
    trainer:
      accelerator: ddp
      benchmark: false
      deterministic: false
      gpus: 1
      precision: 32
      plugins: null
      max_steps: 10000000
      profiler: simple
      num_sanity_val_steps: 0
      log_every_n_steps: 200
      limit_val_batches: 0
    dataset:
      dataloader:
        prefetch_factor: 2
        pin_memory: true
        drop_last: true
        persistent_workers: true
        num_workers: 12
        batch_size: 24
      name: ImageFolderDataModule
      resolution: 256
      category: bedroom
      path: /home/yimingsu/PythonProjects/blobgan/resizedout/
    mode: fit
    seed: 0
    checkpoint:
      every_n_train_steps: 1500
      save_top_k: -1
      mode: max
      monitor: step
    model:
      name: BlobGAN
      lr: 0.002
      dim: 512
      noise_dim: 512
      resolution: 256
      lambda:
        D_real: 1
        D_fake: 1
        D_R1: 50
        G: 1
        G_path: 2
        G_feature_mean: 10
        G_feature_variance: 10
      discriminator:
        name: StyleGANDiscriminator
        size: 256
      generator:
        name: models.networks.layoutstylegan.LayoutStyleGANGenerator
        style_dim: 512
        n_mlp: 8
        size_in: 16
        c_model: 96
        spatial_style: true
        size: 256
      layout_net:
        name: models.networks.layoutnet.LayoutGenerator
        n_features_max: 10
        feature_dim: 768
        style_dim: 512
        noise_dim: 512
        norm_features: true
        mlp_lr_mul: 0.01
        mlp_hidden_dim: 1024
        spatial_style: true
      D_reg_every: 16
      G_reg_every: -1
      λ:
        D_real: 1
        D_fake: 1
        D_R1: 50
        G: 1
        G_path: 2
        G_feature_mean: 10
        G_feature_variance: 10
      log_images_every_n_steps: 1000
      n_features_min: 10
      n_features_max: 10
      n_features: 10
      spatial_style: true
      feature_jitter_xy: 0.04
      feature_jitter_shift: 0.5
      feature_jitter_angle: 0.1
    
    Global seed set to 0
    wandb: Currently logged in as: yimingsu (use `wandb login --relogin` to force relogin)
    wandb: wandb version 0.13.2 is available!  To upgrade, please run:
    wandb:  $ pip install wandb --upgrade
    wandb: Tracking run with wandb version 0.12.11
    wandb: Run data is saved locally in /home/yimingsu/PythonProjects/blobgan/logs/wandb/run-20220902_114754-xjimkxit
    wandb: Run `wandb offline` to turn off syncing.
    wandb: Syncing run 10-blob BlobGAN on bedrooms
    wandb: ⭐️ View project at https://wandb.ai/yimingsu/Blobgan%20investigation
    wandb: 🚀 View run at https://wandb.ai/yimingsu/Blobgan%20investigation/runs/xjimkxit
    [2022-09-02 11:47:58,898][torch.distributed.nn.jit.instantiator][INFO] - Created a temporary directory at /tmp/tmpr5cdgp32
    [2022-09-02 11:47:58,898][torch.distributed.nn.jit.instantiator][INFO] - Writing /tmp/tmpr5cdgp32/_remote_module_non_sriptable.py
    Froze 65 parameters - ['conv1.conv', 'conv1.noise', 'conv1.activate', 'to_rgb1', 'to_rgb1.conv', 'convs.0', 'convs.1', 'convs.2', 'convs.3', 'convs.4', 'convs.5', 'convs.6', 'convs.7', 'to_rgbs.0', 'to_rgbs.1', 'to_rgbs.2', 'to_rgbs.3'] - for model of type LayoutStyleGANGenerator
    Froze 16 parameters - ['mlp.1', 'mlp.2', 'mlp.3', 'mlp.4', 'mlp.5', 'mlp.6', 'mlp.7', 'mlp.8'] - for model of type LayoutGenerator
    [2022-09-02 11:47:59,637][py.warnings][WARNING] - /home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/connectors/accelerator_connector.py:286: LightningDeprecationWarning: Passing `Trainer(accelerator='ddp')` has been deprecated in v1.5 and will be removed in v1.7. Use `Trainer(strategy='ddp')` instead.
      rank_zero_deprecation(
    
    [2022-09-02 11:47:59,637][py.warnings][WARNING] - /home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/connectors/callback_connector.py:147: LightningDeprecationWarning: Setting `Trainer(checkpoint_callback=True)` is deprecated in v1.5 and will be removed in v1.7. Please consider using `Trainer(enable_checkpointing=True)`.
      rank_zero_deprecation(
    
    GPU available: True, used: True
    TPU available: False, using: 0 TPU cores
    IPU available: False, using: 0 IPUs
    Global seed set to 0
    initializing distributed: GLOBAL_RANK: 0, MEMBER: 1/1
    [2022-09-02 11:47:59,641][torch.distributed.distributed_c10d][INFO] - Added key: store_based_barrier_key:1 to store for rank: 0
    [2022-09-02 11:47:59,641][torch.distributed.distributed_c10d][INFO] - Rank 0: Completed store-based barrier for key:store_based_barrier_key:1 with 1 nodes.
    ----------------------------------------------------------------------------------------------------
    distributed_backend=nccl
    All distributed processes registered. Starting with 1 processes
    ----------------------------------------------------------------------------------------------------
    
    Warning: no images found in /home/yimingsu/PythonProjects/blobgan/resizedout/train. Using empty dataset for split train. Perhaps you set `dataset.path` incorrectly?
    Warning: no images found in /home/yimingsu/PythonProjects/blobgan/resizedout/validate. Using empty dataset for split validate. Perhaps you set `dataset.path` incorrectly?
    Warning: no images found in /home/yimingsu/PythonProjects/blobgan/resizedout/test. Using empty dataset for split test. Perhaps you set `dataset.path` incorrectly?
    LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
    Optimizing 57.19M params for G and 28.86M params for D
    
      | Name           | Type                    | Params
    -----------------------------------------------------------
    0 | discriminator  | StyleGANDiscriminator   | 28.9 M
    1 | generator_ema  | LayoutStyleGANGenerator | 35.9 M
    2 | generator      | LayoutStyleGANGenerator | 35.9 M
    3 | layout_net_ema | LayoutGenerator         | 21.3 M
    4 | layout_net     | LayoutGenerator         | 21.3 M
    -----------------------------------------------------------
    86.1 M    Trainable params
    57.2 M    Non-trainable params
    143 M     Total params
    573.008   Total estimated model params size (MB)
    [2022-09-02 11:48:01,076][py.warnings][WARNING] - /home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/torch/utils/data/dataloader.py:487: UserWarning: This DataLoader will create 12 worker processes in total. Our suggested max number of worker in current system is 8, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
      warnings.warn(_create_warning_msg(
    
    Training: 0it [00:00, ?it/s]Error executing job with overrides: ['+experiment=[blobgan,local,jitter]', 'wandb.name=10-blob BlobGAN on bedrooms', 'dataset=imagefolder', '++dataset.path=/home/yimingsu/PythonProjects/blobgan/resizedout/']
    Traceback (most recent call last):
      File "/home/yimingsu/PythonProjects/blobgan/src/run.py", line 81, in run
        trainer.fit(model, datamodule=datamodule)
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit
        self._call_and_handle_interrupt(
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
        return trainer_fn(*args, **kwargs)
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
        self._run(model, ckpt_path=ckpt_path)
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
        self._dispatch()
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
        self.training_type_plugin.start_training(self)
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
        self._results = trainer.run_stage()
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
        return self._run_train()
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1319, in _run_train
        self.fit_loop.run()
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/loops/base.py", line 140, in run
        self.on_run_start(*args, **kwargs)
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/loops/fit_loop.py", line 200, in on_run_start
        self.trainer.call_hook("on_train_start")
      File "/home/yimingsu/anaconda3/envs/blobgan/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1501, in call_hook
        output = model_fx(*args, **kwargs)
      File "/home/yimingsu/PythonProjects/blobgan/src/models/blobgan.py", line 131, in on_train_start
        assert not ((self.log_fid_every_n_steps > -1 or self.log_fid_every_epoch) and (not self.fid_stats_name)), \
    AssertionError: Cannot compute FID without name of statistics file to use.
    
    Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
    

    Any help would be greatly appreciated!

    Best, Yiming

    opened by yimingsu01 3
  • How to edit blobs?

    How to edit blobs?

    Hi,

    Thanks for the repo. It is pretty interesting to play around.

    I am wondering how do I edit the blobs to make things vanish? Presumably, I will be editing the outputs from the inversion models, right? So, how should I do that?

    Best, Jian

    opened by shijianjian 3
  • Regarding the running time

    Regarding the running time

    Hi.

    While reading the paper, I'm a little bit confused of the training time for the BlobGAN.

    Specifically, in the Appendix E.1 in the paper, it is written as "We train all models for 1.5 million gradient steps with batch size 24 per-GPU across 8 NVIDIA A100 GPUs. This takes around 4 weeks."

    Now I'm wondering if it takes 4 weeks with 8 NVIDIA A100 GPUs for training a single model or for all models.

    Could you please clarify this more?

    Thanks!

    opened by 1Konny 2
  • Blob size and opacity

    Blob size and opacity

    Hello, I have some questions regarding paragraph 3.1 of the paper:

    • have you tried to make the constant 'c' controlling blob edge sharpness a trainable parameter?
    • correct me if I am wrong, but when 's' is positive, the maximum opacity of the blob is not located at its centroid but at a distance s from it. Is this coorect? Is it the expected behaviour? Does the model learn only negative sizes to avoid this?
    • Blobs size and opacity are controlled with the same parameter 's', so when we increase 's_k' of a blob k when editing an image we are increasing its size as well as its maximum opacity ==> this will change score values even at the center of the blob ==> more weights to the style vector of blob k ==> style in that region will change too. Haven't you tried to model size and maximum opacity using two different parameters? eg. modeling the opacity as a gaussian function centred at the centroid (x,y) with a standard deviation 's' cotrolling its size and multiplied by a scale factor 'm' controlling the maximum opacity of the blob $$ o(x_{grid}) = m \sigma_{s}(d(x_{grid},x) $$

    Best, Mehdi

    opened by zmehdiz97 2
  • Changing number of blobs

    Changing number of blobs

    In appendix E.1 Hyperparameters of your paper you mentioned that you used different model configurations depending on the dataset (number of objects per image). I want to train a model with k=40, d_in= 256 and d_style=256. I changed output shape of the layout network according to these values and 'c_model' of the generator to 32 to match to spatial_style number of channels.

    This is my config file:

    model: name: BlobGAN lr: 0.002 dim: 256 noise_dim: 512 resolution: 256 lambda: D_real: 1 D_fake: 1 D_R1: 50 G: 1 G_path: 2 G_feature_mean: 10 G_feature_variance: 10 discriminator: name: StyleGANDiscriminator size: ${model.resolution} generator: name: models.networks.layoutstylegan.LayoutStyleGANGenerator style_dim: ${model.dim} n_mlp: 8 size_in: 16 c_model: 32 spatial_style: ${model.spatial_style} size: ${model.resolution} layout_net: name: models.networks.layoutnet.LayoutGenerator n_features_max: ${model.n_features_max} feature_dim: 256 style_dim: ${model.dim} noise_dim: ${model.noise_dim} norm_features: true mlp_lr_mul: 0.01 mlp_hidden_dim: 1024 spatial_style: ${model.spatial_style} n_features_min: ${model.n_features} n_features_max: ${model.n_features} n_features: 40 spatial_style: true

    Hower with this configuration I get very few parameters in the generator:

    | Name | Type | Params 0 | discriminator | StyleGANDiscriminator | 28.9 M 1 | generator_ema | LayoutStyleGANGenerator | 4.2 M 2 | generator | LayoutStyleGANGenerator | 4.2 M 3 | layout_net_ema | LayoutGenerator | 28.6 M 4 | layout_net | LayoutGenerator | 28.6 M

    61.7 M Trainable params 32.9 M Non-trainable params 94.6 M Total params 378.321 Total estimated model params size (MB)

    opened by zmehdiz97 2
  • Inversion

    Inversion

    Hi,

    I have a question regarding image inversion. To train the encoder, did you use the jittering of the spatial parameters? In the 'invertblobgan.py' code no_jitter is not used and the invertblobgan.yaml doesn't set the jittering parameters to 0. Is this intended?

    opened by zmehdiz97 1
  • Pretrained encoder

    Pretrained encoder

    Thank you for providing the code. Your work is very interesting. Do you intend to provide the weights of the encoder for image inversion? on bedroom for example? Thank you

    opened by zmehdiz97 1
  • Restyling and cloning code

    Restyling and cloning code

    Thanks for your great work and well-organized code! Could you please also share the restyling and cloning code? I tried restyling, but I'm not sure what's the thin border of the blob; I also tried cloning by simply copying all the parameters of one blob, but I can't get the same object on the image.

    opened by QianWangX 0
Owner
PhD student at UC Berkeley
null
An official reimplementation of the method described in the INTERSPEECH 2021 paper - Speech Resynthesis from Discrete Disentangled Self-Supervised Representations.

Speech Resynthesis from Discrete Disentangled Self-Supervised Representations Implementation of the method described in the Speech Resynthesis from Di

Facebook Research 253 Jan 6, 2023
Implementation of the method described in the Speech Resynthesis from Discrete Disentangled Self-Supervised Representations.

Speech Resynthesis from Discrete Disentangled Self-Supervised Representations Implementation of the method described in the Speech Resynthesis from Di

null 4 Mar 11, 2022
Code for CVPR2021 paper 'Where and What? Examining Interpretable Disentangled Representations'.

PS-SC GAN This repository contains the main code for training a PS-SC GAN (a GAN implemented with the Perceptual Simplicity and Spatial Constriction c

Xinqi/Steven Zhu 40 Dec 16, 2022
Official PyTorch code for Mutual Affine Network for Spatially Variant Kernel Estimation in Blind Image Super-Resolution (MANet, ICCV2021)

Mutual Affine Network for Spatially Variant Kernel Estimation in Blind Image Super-Resolution (MANet, ICCV2021) This repository is the official PyTorc

Jingyun Liang 139 Dec 29, 2022
Official PyTorch code of DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context Graph and Relation-based Optimization (ICCV 2021 Oral).

DeepPanoContext (DPC) [Project Page (with interactive results)][Paper] DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context G

Cheng Zhang 66 Nov 16, 2022
Implementation of Cross Transformer for spatially-aware few-shot transfer, in Pytorch

Cross Transformers - Pytorch (wip) Implementation of Cross Transformer for spatially-aware few-shot transfer, in Pytorch Install $ pip install cross-t

Phil Wang 40 Dec 22, 2022
PyTorch Implementation of Spatially Consistent Representation Learning(SCRL)

Spatially Consistent Representation Learning (CVPR'21) Official PyTorch implementation of Spatially Consistent Representation Learning (SCRL). This re

Kakao Brain 102 Nov 3, 2022
This is an official implementation of our CVPR 2021 paper "Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression" (https://arxiv.org/abs/2104.02300)

Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression Introduction In this paper, we are interested in the bottom-up paradigm of estima

HRNet 367 Dec 27, 2022
Pytorch implementation of Make-A-Scene: Scene-Based Text-to-Image Generation with Human Priors

Make-A-Scene - PyTorch Pytorch implementation (inofficial) of Make-A-Scene: Scene-Based Text-to-Image Generation with Human Priors (https://arxiv.org/

Casual GAN Papers 259 Dec 28, 2022
Implementation of CVPR 2021 paper "Spatially-invariant Style-codes Controlled Makeup Transfer"

SCGAN Implementation of CVPR 2021 paper "Spatially-invariant Style-codes Controlled Makeup Transfer" Prepare The pre-trained model is avaiable at http

null 118 Dec 12, 2022
Simple Tensorflow implementation of Toward Spatially Unbiased Generative Models (ICCV 2021)

Spatial unbiased GANs — Simple TensorFlow Implementation [Paper] : Toward Spatially Unbiased Generative Models (ICCV 2021) Abstract Recent image gener

Junho Kim 16 Apr 15, 2022
Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation in PyTorch

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Ima

Xuanchi Ren 86 Dec 7, 2022
A weakly-supervised scene graph generation codebase. The implementation of our CVPR2021 paper ``Linguistic Structures as Weak Supervision for Visual Scene Graph Generation''

README.md shall be finished soon. WSSGG 0 Overview 1 Installation 1.1 Faster-RCNN 1.2 Language Parser 1.3 GloVe Embeddings 2 Settings 2.1 VG-GT-Graph

Keren Ye 35 Nov 20, 2022
CVPR 2021: "The Spatially-Correlative Loss for Various Image Translation Tasks"

Spatially-Correlative Loss arXiv | website We provide the Pytorch implementation of "The Spatially-Correlative Loss for Various Image Translation Task

Chuanxia Zheng 89 Jan 4, 2023
Spatially-Adaptive Pixelwise Networks for Fast Image Translation, CVPR 2021

Image Translation with ASAPNets Spatially-Adaptive Pixelwise Networks for Fast Image Translation, CVPR 2021 Webpage | Paper | Video Installation insta

Tamar Rott Shaham 100 Dec 28, 2022
Toward Spatially Unbiased Generative Models (ICCV 2021)

Toward Spatially Unbiased Generative Models Implementation of Toward Spatially Unbiased Generative Models (ICCV 2021) Overview Recent image generation

Jooyoung Choi 88 Dec 1, 2022
Dynamical movement primitives (DMPs), probabilistic movement primitives (ProMPs), spatially coupled bimanual DMPs.

Movement Primitives Movement primitives are a common group of policy representations in robotics. There are many different types and variations. This

DFKI Robotics Innovation Center 63 Jan 6, 2023
Code for "Learning Canonical Representations for Scene Graph to Image Generation", Herzig & Bar et al., ECCV2020

Learning Canonical Representations for Scene Graph to Image Generation (ECCV 2020) Roei Herzig*, Amir Bar*, Huijuan Xu, Gal Chechik, Trevor Darrell, A

roei_herzig 24 Jul 7, 2022
Code release for BlockGAN: Learning 3D Object-aware Scene Representations from Unlabelled Images

BlockGAN Code release for BlockGAN: Learning 3D Object-aware Scene Representations from Unlabelled Images BlockGAN: Learning 3D Object-aware Scene Rep

null 41 May 18, 2022