Downloads · 30 days
0
murali5613/rcan-large-lowlight-4x-sr
rcan-large-lowlight-4x-sr is a image-to-image model from murali5613. Use it when you need one image transformed into another. The card lists the license as mit.
This repository hosts the Flagship RCAN-Large model for joint low-light image enhancement, noise suppression, and 4x super-resolution.
Downloads · 30 days
0
Access
Public
Updated Sep 6, 2026
Repo size
23.6 MB
Likes
1
Public
Click a slice to open those files.
.pth21.9 MB · 93%
From the Hugging Face model README
This repository hosts the Flagship RCAN-Large model for joint low-light image enhancement, noise suppression, and 4x super-resolution.
Achieved 39.72 dB PSNR on the competitive evaluation benchmark.

Left: Low-light noisy input (4x bicubic upsampled) | Middle: RCAN-Large 4x enhanced output | Right: Ground truth clean high-resolution image.
import torch
import numpy as np
from PIL import Image
from model import get_model
# 1. Initialize Model
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = get_model(scale=4, num_groups=8, num_blocks=8).to(device)
# 2. Load Weights
weights_path = 'rcan_large_4x.pth'
state_dict = torch.load(weights_path, map_location=device)
if 'state_dict' in state_dict:
state_dict = state_dict['state_dict']
clean_sd = {k.replace('module.', ''): v for k, v in state_dict.items()}
model.load_state_dict(clean_sd)
model.eval()
# 3. Enhance Low-Light Image
image = Image.open('input_lowlight.png').convert('RGB')
input_tensor = torch.from_numpy(np.array(image).astype(np.float32) / 255.0).permute(2, 0, 1).unsqueeze(0).to(device)
with torch.no_grad():
enhanced_tensor = model(input_tensor).clamp(0.0, 1.0)
enhanced_np = (enhanced_tensor[0].cpu().permute(1, 2, 0).numpy() * 255.0).round().astype(np.uint8)
enhanced_image = Image.fromarray(enhanced_np)
enhanced_image.save('output_enhanced_4x.png')
print("Restored 4x high-resolution image saved to output_enhanced_4x.png!")
| Model | Setup | Kaggle PSNR |
|---|---|---|
| Baseline (Stage 1) | 64x64 patches, 30 blocks | 39.25 dB |
| Stage 2 | 96x96 patches | 39.36 dB |
| Stage 3 | Luminance Loss + All Data | 39.43 dB |
| RCAN-Large (Stage 4) | 128x128 patches, 64 blocks, Lum Loss, 8x TTA | 39.718 dB |