Skip to content

PyTorch implementation of 'Pix2Pix' (Isola et al., 2017) and training it on Facades and Google Maps

Notifications You must be signed in to change notification settings

KimRass/Pix2Pix

Repository files navigation

1. Pre-trained Models

Trained on Facades for 200 epochs pix2pix_facades.pth
Trained on Google Maps for 400 epochs pix2pix_google_maps.pth

2. Sampling

3. Implementation Details

1) Image Mean and STD

  • Facades dataset의 Training set에 대해 Input image와 Output image 각각에 대해 Mean과 STD를 계산하면 다음과 같습니다.
    FACADES_INPUT_IMG_MEAN = (0.222, 0.299, 0.745)
    FACADES_INPUT_IMG_STD = (0.346, 0.286, 0.336)
    FACADES_OUTPUT_IMG_MEAN = (0.478, 0.453, 0.417)
    FACADES_OUTPUT_IMG_STD = (0.243, 0.235, 0.236)
    
  • 반면 다음과 같이 설정하면 모델에 입력되는 모든 tensors의 값이 $[-1, 1]$의 값을 갖게 됩니다.
    FACADES_INPUT_IMG_MEAN = (0.5, 0.5, 0.5)
    FACADES_INPUT_IMG_STD = (0.5, 0.5, 0.5)
    FACADES_OUTPUT_IMG_MEAN = (0.5, 0.5, 0.5)
    FACADES_OUTPUT_IMG_STD = (0.5, 0.5, 0.5)
    
  • 두 가지 Settings를 가지고 실험을 해 본 결과, 후자의 학습 속도가 전자보다 빨랐습니다.

2) Architecture

  • self.norm = nn.InstanceNorm2d(out_channels, affine=True, track_running_stats=False)로 설정 시 다음과 같이 모델이 생성한 이미지가 다음과 같이 Blurry했습니다.
  • self.norm = nn.InstanceNorm2d(out_channels, affine=False, track_running_stats=False)로 수정하자 이런 현상이 없어졌습니다.
  • Instance norm은 원래 기본적으로 track_running_stats=False을 사용합니다.

About

PyTorch implementation of 'Pix2Pix' (Isola et al., 2017) and training it on Facades and Google Maps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published