You can run SwinIR for several restoration tasks using the main_test_swinir.py script. The script supports classical super-resolution, lightweight super-resolution, real-world super-resolution, denoising (grayscale and color), and JPEG artifact reduction.
Key CLI Arguments:
--task: The restoration task (e.g., classical_sr, lightweight_sr, real_sr, gray_dn, color_dn, jpeg_car, color_jpeg_car).--scale: The upscaling factor (for SR tasks).--model_path: Path to the pretrained .pth model file.--folder_lq: Path to the folder containing low-quality input images.--folder_gt: Path to the folder containing ground-truth images (used for evaluation).--tile: Use this flag (e.g., --tile 400) if you encounter out-of-memory errors during real-world SR.--large_model: Use this flag for larger models in real-world SR.--noise: Specify the noise level (for denoising tasks).--jpeg: Specify the JPEG quality factor (for artifact reduction tasks).