Fast, deployement-ready static image deraining model for autonomous driving, surveillance, and photo restoration.
30.9 PSNR / 0.914 SSIM on Rain1400 โข ~15ms inference (RTX 4070) โข L1 loss + vanilla UNet = best results
git clone https://github.com/dronefreak/clearview.git
cd clearview
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt && pip install -e .clearview-infer --image rainy.jpg --weights clearview-unet.pth --output clean.jpgclearview-train \
--data-dir /path/to/Rain1400 \
--model unet --loss l1 --optimizer adamw --lr 1e-4 \
--batch-size 24 --epochs 200 --dataset-type rain1400| Model | PSNR | SSIM | Params | Speed |
|---|---|---|---|---|
| UNet (L1) | 30.91 | 0.914 | 7.8M | ~15ms |
| Attention UNet | 30.04 | 0.910 | 8.9M | ~20ms |
โ
Key insight: L1 loss alone outperforms complex multi-loss combos.
- Backbone: Vanilla UNet (4 encoder/decoder blocks + skip connections)
- Output: Sigmoid-bounded to [0,1]
- Loss: Pixel-wise L1 (
loss = L1(pred, target)) - Why not attention? No measurable gainโadds latency and params.
Download from Hugging Face:
from huggingface_hub import hf_hub_download
weights = hf_hub_download("dronefreak/clearview-unet", "clearview-unet.pth")๐ Model Card
- Rain1400 (recommended): 12.6K train / 1.4K test
- Rain100H/L: Heavy/light rain variants
- Custom: Organize as
train/{rainy_image,ground_truth}
- Video: Frame-by-frame processing via
scripts/video_demo.py(no temporal consistency yet) - Metrics:
clearview-evalreports PSNR, SSIM, MAE, MSE - Training Tips:
- Use mixed precision + gradient clipping
- Early stopping (patience=50)
- Avoid multi-component losses
- Temporal consistency for video
- Real-world rain dataset
- Mobile deployment (ONNX/TensorRT)
- Snow/fog/haze removal
PRs welcome! See CONTRIBUTING.md.
Need help? Open an Issue.
@software{saksena2025clearview,
author = {Saksena, Saumya Kumaar},
title = {ClearView: Practical Image Deraining with PyTorch},
year = {2025},
url = {https://github.com/dronefreak/clearview}
}License: Apache 2.0
Author: Saumya Kumaar Saksena (@dronefreak)

