Skip to content

Commit

Permalink
Merge pull request #3 from Joejiong/joe-gan-dev1
Browse files Browse the repository at this point in the history
Add shell to download several datasets
  • Loading branch information
qingqing01 authored Jul 9, 2020
2 parents 0ea2997 + 555d54b commit 3211114
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ venv.bak/
/site

# mypy
.mypy_cache/
.mypy_cache/

# data
data/
output_dir/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
English | [简体中文](./README.md)

# PaddleGAN

still under development!!

## Download Dataset
This script could download several dataset for paired images for image2image translation task.

```
cd PaddleGAN/script/
bash pix2pix_download.sh [cityscapes|facades|edges2handbags|edges2shoes|maps]
```
## Train
```
python -u tools/main.py --config-file configs/cyclegan-cityscapes.yaml
Expand Down
70 changes: 70 additions & 0 deletions configs/pix2pix_facades.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
epochs: 200
isTrain: True
output_dir: output_dir
lambda_L1: 100

model:
name: Pix2PixModel
generator:
name: UnetGenerator
norm_type: batch
input_nc: 3
output_nc: 3
num_downs: 8 #unet256
ngf: 64
use_dropout: False
discriminator:
name: NLayerDiscriminator
ndf: 64
n_layers: 3
input_nc: 6
norm_type: batch
gan_mode: vanilla

dataset:
train:
name: PairedDataset
dataroot: data/facades/
phase: train
max_dataset_size: inf
direction: BtoA
input_nc: 3
output_nc: 3
serial_batches: False
pool_size: 0
transform:
load_size: 286
crop_size: 256
preprocess: resize_and_crop
no_flip: False
test:
name: PairedDataset
dataroot: data/facades/
phase: test
max_dataset_size: inf
direction: BtoA
input_nc: 3
output_nc: 3
serial_batches: True
pool_size: 50
transform:
load_size: 256
crop_size: 256
preprocess: resize_and_crop
no_flip: True

optimizer:
name: Adam
beta1: 0.5
lr_scheduler:
name: linear
learning_rate: 0.0002
start_epoch: 100
decay_epochs: 100

log_config:
interval: 100
visiual_interval: 500

snapshot_config:
interval: 5
9 changes: 9 additions & 0 deletions script/pix2pix_download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FILE=$1
URL=https://people.eecs.berkeley.edu/~tinghuiz/projects/pix2pix/datasets/$FILE.tar.gz
TAR_FILE=./$FILE.tar.gz
TARGET_DIR=./$FILE/
wget -N $URL -O $TAR_FILE --no-check-certificate
mkdir $TARGET_DIR
tar -zxvf $TAR_FILE -C ../data/
rm $TAR_FILE
rm -rf $TARGET_DIR

0 comments on commit 3211114

Please sign in to comment.