/URDGN

Ultra-resolving face images by discriminative generative networks

Primary LanguageLua

Ultra-resolving face images by discriminative generative networks (URDGN)

ECCV 2016

Face Hallucination

Run this code with more than 8G of GPU

The source code is provided by https://github.com/XinYuANU/URDGN. Thanks for their works.

@inproceedings{Xin2016Ultra,
  title={Ultra-Resolving Face Images by Discriminative Generative Networks},
  author={Xin, Yu and Porikli, Fatih},
  booktitle={European Conference on Computer Vision},
  year={2016},
}

1. move all images (train and test) to folder datasets and creat .h5 file

python create_YTC_xin.py

If you want to use your datasets, try to modify the code as follows.

#52 x = create_YTC(pathfolder, 18) the size of low-resolution images

#61 x = create_YTC(pathfolder, 144) the size of high-resolution images

2.train URDGN

th train_ytc_xin_128_D.lua

just change the code of train_ytc_xin_128_D.lua

#39 --scale (default 144) the size of high-resolution images

#48 ntrain = 1600 the num of train images

#49 nval = 40 the num of test images

#112 model_D:add(nn.Reshape(9 *9 *96)) --9 = 144 / (2 ^ 4)

#113 model_D:add(nn.Linear(9 *9 *96, 1024))

#198 local noise_inputs = torch.Tensor(N, 3, 18, 18)

#204 noise_inputs[{{i}}] = image.scale(torch.squeeze(noise_input_high[{{idx}}]),18,18)

#224 local to_plot = getSamples(valData_HR, 40) the num of test images

#232 local formatted = image.toDisplayTensor({input=to_plot, nrow=10})

#239 IDX = torch.randperm(1600) the num of train images

just change the code of adverserial_xin_v1_D.lua

#135 local LR_inputs = torch.Tensor(opt.batchSize, 3, 18, 18) the size of low-resolution images

#243 local sample = torch.Tensor(dataBatchSize, 3, 18, 18) the size of low-resolution images

#348 local inputs_lr = torch.Tensor(opt.batchSize, 3, 18, 18) the size of low-resolution images

3.This code can split the result and save them as images in folder sr

run getimg.m