Skip to content

Commit c466b9b

Browse files
committed
update trainining
1 parent 2bbdcc1 commit c466b9b

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ python inference_gfpgan_full.py --model_path experiments/pretrained_models/GFPGA
8181
We provide complete training codes for GFPGAN. <br>
8282
You could improve it according to your own needs.
8383

84+
1. Dataset preparation: [FFHQ](https://github.com/NVlabs/ffhq-dataset)
85+
86+
1. Download pre-trained models and other data. Put them in the `experiments/pretrained_models` folder.
87+
1. [Pretrained StyleGAN2 model: StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth)
88+
1. [Component locations of FFHQ: FFHQ_eye_mouth_landmarks_512.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/FFHQ_eye_mouth_landmarks_512.pth)
89+
1. [A simple ArcFace model: arcface_resnet18.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/arcface_resnet18.pth)
90+
91+
1. Modify the configuration file `train_gfpgan_v1.yml` accordingly.
92+
93+
1. Training
94+
8495
> python -m torch.distributed.launch --nproc_per_node=4 --master_port=22021 train.py -opt train_gfpgan_v1.yml --launcher pytorch
8596

8697
## :scroll: License and Acknowledgement

README_CN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ python inference_gfpgan_full.py --model_path experiments/pretrained_models/GFPGA
8181
We provide complete training codes for GFPGAN. <br>
8282
You could improve it according to your own needs.
8383

84+
1. Dataset preparation: [FFHQ](https://github.com/NVlabs/ffhq-dataset)
85+
86+
1. Download pre-trained models and other data. Put them in the `experiments/pretrained_models` folder.
87+
1. [Pretrained StyleGAN2 model: StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth)
88+
1. [Component locations of FFHQ: FFHQ_eye_mouth_landmarks_512.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/FFHQ_eye_mouth_landmarks_512.pth)
89+
1. [A simple ArcFace model: arcface_resnet18.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/arcface_resnet18.pth)
90+
91+
1. Modify the configuration file `train_gfpgan_v1.yml` accordingly.
92+
93+
1. Training
94+
8495
> python -m torch.distributed.launch --nproc_per_node=4 --master_port=22021 train.py -opt train_gfpgan_v1.yml --launcher pytorch
8596

8697
## :scroll: License and Acknowledgement
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Pre-trained Models and Other Data
2+
3+
Download pre-trained models and other data. Put them in this folder.
4+
5+
1. [Pretrained StyleGAN2 model: StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth)
6+
1. [Component locations of FFHQ: FFHQ_eye_mouth_landmarks_512.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/FFHQ_eye_mouth_landmarks_512.pth)
7+
1. [A simple ArcFace model: arcface_resnet18.pth](https://github.com/TencentARC/GFPGAN/releases/download/v0.1.0/arcface_resnet18.pth)

train_gfpgan_v1.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ datasets:
99
train:
1010
name: FFHQ
1111
type: FFHQDegradationDataset
12-
dataroot_gt: datasets/ffhq/ffhq_512.lmdb
12+
# dataroot_gt: datasets/ffhq/ffhq_512.lmdb
13+
dataroot_gt: datasets/ffhq/ffhq_512
1314
io_backend:
14-
type: lmdb
15+
# type: lmdb
16+
type: disk
1517

1618
use_hflip: true
1719
mean: [0.5, 0.5, 0.5]
@@ -44,10 +46,12 @@ datasets:
4446
prefetch_mode: ~
4547

4648
val:
47-
name: validation1020_512
49+
# Please modify accordingly to use your own validation
50+
# Or comment the val block if do not need validation during training
51+
name: validation
4852
type: PairedImageDataset
49-
dataroot_lq: datasets/faces/validation1020_512/input # TODO: modify before release
50-
dataroot_gt: datasets/faces/validation1020_512/input
53+
dataroot_lq: datasets/faces/validation/input
54+
dataroot_gt: datasets/faces/validation/reference
5155
io_backend:
5256
type: disk
5357
mean: [0.5, 0.5, 0.5]

0 commit comments

Comments
 (0)