Continuous Implicit Feature Representation
- Adversarial Training (Generator: Encoder + LIIF, Discriminator: U-Net based)
- An Encoder is StyleGAN based architecture (Noise Injection for generating fine-grained details)
- Contextual Loss
apt install ninja-build
pip install -r requirements.txt
Download Train Data (HR images) and Validation Data (HR images) from DIV2K Dataset.
curl -L http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_HR.zip -o DIV2K_train_HR.zip
curl -L http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_HR.zip -o DIV2K_valid_HR.zip
Decompress thease files to ./sr_dataset folder.
unzip DIV2K_train_HR.zip
unzip DIV2K_valid_HR.zip
You have the folder structure.
./sr_dataset
|
|-- DIV2K_train_HR
|
|-- DIV2K_valid_HR
For single-gpu training,
export PYTHONPATH=$(pwd)
python tools/train.py --config configs/div2k_stylegan_sn_liif.py
For multi-gpu training,
python -m torch.distributed.run --nproc_per_node=4 \
tools/train_dist.py \
--config configs/div2k_stylegan_sn_liif.py
export PYTHONPATH=$(pwd)
python tools/inference_liif.py \
--config configs/div2k_stylegan_sn_liif.py \
--ckpt work_dir/div2k_stylegan_sn_liif/checkpoints/000200.pth \
--img test.jpg
Really thank the authors of LIIF for sharing their codes and research.
[1] Learning Continuous Image Representation with Local Implicit Image Function, Yinbo Chen et al.