Code for ICCV 2021 paper: Scene Synthesis via Uncertainty-Driven Attribute Synchronization
Environment: python 3.6 and cuda 10.0 on Ubuntu 18.04
- Pytorch 1.4.0
- tensorflow 1.14.0 (for tensorboard)
βββdataset_3dfront/
βββdata
βββ bedroom
βββ 0_abs.npy
βββ 0_rel.pkl
βββ ...
βββ living
βββ 0_abs.npy
βββ 0_rel.pkl
βββ ...
βββ train_bedroom.txt
βββ train_living.txt
βββ val_bedroom.txt
βββ val_living.txt
See 3D-FRONT Dataset for dataset generation.
Download the pretrained model from https://drive.google.com/file/d/1VKNlEdUj1RBUOjBaBxE5xQvfsZodVjam/view?usp=sharing
Sync2Gen
βββ log
βββ 3dfront
βββ bedroom
βΒ Β βββ vaef_lr0001_w00001_B64
βΒ Β βββ checkpoint_eval799.tar
βΒ Β βββ pairs
βββ living
βββ vaef_lr0001_w00001_B64
βββ checkpoint_eval799.tar
βββ pairs
type='bedroom'; # or living
CUDA_VISIBLE_DEVICES=0 python ./test_sparse.py --type $type --log_dir ./log/3dfront/$type/vaef_lr0001_w00001_B64 --model_dict=model_scene_forward --max_parts=80 --num_class=20 --num_each_class=4 --batch_size=32 --variational --latent_dim 20 --abs_dim 16 --weight_kld 0.0001 --learning_rate 0.001 --use_dumped_pairs --dump_results --gen_from_noise --num_gen_from_noise 100
The predictions are dumped in ./dump/$type/vaef_lr0001_w00001_B64
To train the network:
type='bedroom'; # or living
CUDA_VISIBLE_DEVICES=0 python ./train_sparse.py --data_path ./dataset_3dfront/data --type $type --log_dir ./log/3dfront/$type/vaef_lr0001_w00001_B64 --model_dict=model_scene_forward --max_parts=80 --num_class=20 --num_each_class=4 --batch_size=64 --variational --latent_dim 20 --abs_dim 16 --weight_kld 0.0001 --learning_rate 0.001
cd optimization
See Prior generation.
type=bedroom # or living;
bash opt.sh $type vaef_lr0001_w00001_B64 EXP_NAME
We use Pytorch-LBFGS for optimization.
There is a simple visualization tool:
type=bedroom # or living
bash vis.sh $type vaef_lr0001_w00001_B64 EXP_NAME
The visualization is in ./vis. {i:04d}_2(3)d_pred.png is the initial prediction from VAE. {i:04d}_2(3)d_sync.png is the optimized layout after synchronization.
The repo is built based on:
We thank the authors for their great job.
If you have any questions, you can contact Haitao Yang (yanghtr [AT] outlook [DOT] com).
