Min-Yeong Kim*, Seung-Wook Kim*, and Keunsoo Ko, "Reference-Guided Transformer for Face Super-Resolution"
*These authors contributed equally to this work.
# 1. Clone repository
git clone https://github.com/keunsoo-ko/RGFormer.git
cd RGFormer
# 2. Create anaconda environment
conda create -n rgformer python=3.9 -y
conda activate rgformer
# 3. Install PyTorch
pip install torch==2.0.0+cu118 torchvision==0.15.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
# 4. Install dependencies
pip install -r requirements.txt
# 5. Install CodeFormer
git clone https://github.com/sczhou/CodeFormer.git
cd CodeFormer
pip install -r requirements.txt
cd ..Download the pretrained weights from Google Drive and place them in the weights/ directory.
weights/
└── best.pt
dataset/
├── LR/
│ ├── 000001.jpg
│ └── ...
├── Ref/
│ ├── 000001.jpg
│ └── ...
└── Mask/
├── 000001.jpg
└── ...
python train.py \
--lq_dir /path/to/LR \
--ref_dir /path/to/Ref \
--mask_dir /path/to/Mask \
--save_path ./results \
--batch_size 32 \
--max_epoch 150python infer.py \
--lq_dir /path/to/LR \
--ref_dir /path/to/Ref \
--mask_dir /path/to/Mask \
--check_path ./weights/best.pt \
--save_path ./infer_resultsDownload test pairs of target and reference: Google Drive