Downloads · 30 days
20
100% of all-time downloads
aishy26/nppe_3_model
nppe_3_model is a machine learning model from aishy26. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
RRDBNet (Real-ESRGAN generator architecture), fine-tuned from Real-ESRGAN's pretrained RealESRGANx4plus weights on paired low-light noisy/clean image data. Trained with Charbonnier + SSIM pixel loss only — no adversar…
Downloads · 30 days
20
100% of all-time downloads
All-time downloads
20
Public
Repo size
67 MB
Likes
0
Public
Click a slice to open those files.
.pt67 MB · 100%
From the Hugging Face model README
RRDBNet (Real-ESRGAN generator architecture), fine-tuned from Real-ESRGAN's
pretrained RealESRGAN_x4plus weights on paired low-light noisy/clean image
data. Trained with Charbonnier + SSIM pixel loss only — no adversarial or
perceptual loss — since the goal is pixel-accurate reconstruction (PSNR),
not hallucinated texture.
Validation PSNR: 39.51 dB
best.pt — trained model checkpoint (contains model_state, the epoch,
best validation PSNR, and the training config it was produced under)model.py — architecture definition needed to load the checkpointconfig.json — architecture configuration (layer sizes, block count,
scale factor, training settings) used to build the model before loading
the weightsimport json
import torch
import numpy as np
from PIL import Image
from model import RRDBNet
# Load the architecture configuration
with open("config.json") as f:
cfg = json.load(f)
# Build the model using the saved configuration
model = RRDBNet(
num_in_ch=cfg["num_in_ch"],
num_out_ch=cfg["num_out_ch"],
scale=cfg["scale"],
num_feat=cfg["num_feat"],
num_block=cfg["num_block"],
num_grow_ch=cfg["num_grow_ch"],
)
# Load trained weights
ckpt = torch.load("best.pt", map_location="cpu")
model.load_state_dict(ckpt["model_state"])
model.eval()
print("Validation PSNR at save time:", ckpt["best_psnr"])
# Run inference on a low-light noisy image
img = Image.open("your_low_light_image.png").convert("RGB")
x = torch.from_numpy(np.asarray(img, dtype=np.float32) / 255.0).permute(2, 0, 1).unsqueeze(0)
with torch.no_grad():
out = model(x).clamp(0, 1)
out_img = (out[0].permute(1, 2, 0).numpy() * 255).astype(np.uint8)
Image.fromarray(out_img).save("denoised_4x_output.png")
[0, 1],
shape (B, 3, H, W)(B, 3, 4H, 4W)Full configuration values are in config.json.
RealESRGAN_x4plus.pth pretrained
weights (strict key-for-key match, all 702 tensors loaded)