- Python 3.7
- Pytorch 1.13
- NVIDIA GPU + CUDA
- Python packages:
pip install numpy opencv-python pandas tqdm fast_pytorch_kmeans
We provide a demo that performs 4x super-resolution using an original input image (supports only 4x scaling and .png format):
python demo.py --img_path <image path> --k <value> --out_dir <output path> [--adaptive] [--no_refinement]
For a detailed description of the arguments and outputs, please refer to demo.py
and the results
directory.
We offer a variety of pretrained models available in the save
directory.
We use the DIV2K training set as our base.
cd datasets/scripts
python data_augmentation.py
python extract_subimages.py
python generate_mod_LR_bic.py
(Please move the pretrained model to a different directory to train a new model!)
# original model
./dist.sh train.py --config configs/carn-x4.yaml --gpu 0
# PCSR model (2-stage)
./dist.sh train_pcsr.py --config configs/carn-pcsr-phase0.yaml --gpu 0,1
./dist.sh train_pcsr.py --config configs/carn-pcsr-phase1.yaml --gpu 0
Please refer to test.py
and test_pcsr.py
for a detailed description of the arguments.
# original model
python test.py --config <config path> --hr_data <hr foler> --lr_data <lr folder> --per_image --crop
# PCSR model (phase1)
python test_pcsr.py --config <config path> --hr_data <hr foler> --scale <integer scale> --per_image --crop --k 0 [--adaptive]
@inproceedings{jeong2025accelerating,
title={Accelerating Image Super-Resolution Networks with Pixel-Level Classification},
author={Jeong, Jinho and Kim, Jinwoo and Jo, Younghyun and Kim, Seon Joo},
booktitle={European Conference on Computer Vision},
pages={236--251},
year={2025},
organization={Springer}
}