Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WillSuen committed Oct 13, 2019
0 parents commit 69e5ad3
Show file tree
Hide file tree
Showing 44 changed files with 4,540 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

.vscode/

*.pyc
*pynb*

datasets/

outputs/

samples/

eval/

pretrained_model/

eval/model/

build/

roi_layers.egg-info/

*.so

.ftpconfig

.ftpignore
26 changes: 26 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Installation

#### Requiements
* python3
* pytorch 1.0
* numpy
* matplotlib
* opencv

```
pip install -r requiements.txt
# setup for roi_layers
python setup.py build develop
```

#### Data Preparation
Download COCO dataset to `datasets/coco`
```
bash scripts/download_coco.sh
```
Download VG dataset to `datasets/vg`
```
bash scripts/download_vg.sh
python scripts/preprocess_vg.py
```
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# LostGANs: Image Synthesis From Reconfigurable Layout and Style
This is implementation of our ICCV19 paper [**Image Synthesis From Reconfigurable Layout and Style**](https://arxiv.org/abs/1908.07500)

## Network Structure
![network_structure](./figures/network_structure.png)

## Installation
Check [INSTALL.md](INSTALL.md) for installation instructions.
#### 1. Download pretrained model
Download pretrained models to `pretrained_model/`
* Pretrained model on [COCO](https://drive.google.com/open?id=1WO6fLZqJeTUnmJTmieUopKLj9KGBhGd6)
* Pretrained model on [VG](https://drive.google.com/open?id=1A_gP_WwZWonlXJhwcdBDgHuVaGSiVjMO)

#### 2. Train models
```
python train.py --dataset coco --out_path outputs/
```

#### 3. Run pretrained model
```
python test.py --dataset coco --model_path pretrained_model/G_coco.pth --sample_path samples/coco/
```


## Results
###### Multiple samples generated from same layout
![various_out](./figures/various_outs.png)
###### Generation results by adding new objects or change spatial position of object
![add_obj](./figures/add_obj.png)
###### Linear interpolation of instance style
![style_morph](./figures/style_morph.png)
###### Synthesized images and learned masks for given layout
![mask](./figures/mask.png)

## Contact
Please feel free to report issues and any related problems to Wei Sun (wsun12 at ncsu dot edu) and Tianfu Wu (tianfu_wu at ncsu dot edu).


## Reference
* Synchronized-BatchNorm-PyTorch: [https://github.com/vacancy/Synchronized-BatchNorm-PyTorch](https://github.com/vacancy/Synchronized-BatchNorm-PyTorch)
* Image Generation from Scene Graphs: [https://github.com/google/sg2im](https://github.com/google/sg2im)
* Faster R-CNN and Mask R-CNN in PyTorch 1.0: [https://github.com/facebookresearch/maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark)
Empty file added data/__init__.py
Empty file.
Loading

0 comments on commit 69e5ad3

Please sign in to comment.