Datasets:
Tasks:
Image-to-Image
Modalities:
Image
Formats:
imagefolder
Languages:
English
Size:
10K - 100K
ArXiv:
License:
File size: 11,180 Bytes
73d6871 39395ed 73d6871 257b3ed 73d6871 257b3ed 73d6871 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | ---
language:
- en
license: bsd-3-clause
pretty_name: SPA-Data (Unofficial, Subsampled Mirror)
task_categories:
- image-to-image
tags:
- image-restoration
- deraining
- rain-removal
- computer-vision
- real-world
- pytorch
- clearview
size_categories:
- 1K<n<10K
---
# SPA-Data: Real-World Single-Image Deraining Dataset (Unofficial, Subsampled Mirror)
<p align="center">
<img src="banner.jpg" alt="SPA-Data sample rain/clean pairs"/>
</p>






> **Unofficial, subsampled redistribution of SPA-Data**, the real-world rain/rain-free image dataset from SPANet (Wang et al., CVPR 2019), packaged in a directory layout directly consumable by [ClearView](https://github.com/dronefreak/clearview)'s `SPADataDataset` parser.
## Disclaimer
This repository is **not** an official release of SPA-Data.
SPA-Data was created by Tianyu Wang, Xin Yang, Ke Xu, Shaozhe Chen, Qiang Zhang, and Rynson W.H. Lau. This repository does **not** claim ownership of any images or metadata, and attributes the dataset to its original creators. (We describe them as "creators" rather than "copyright holders" deliberately — copyright in academic datasets can rest with an author's university, a funding body, or otherwise, under arrangements we have no way to verify from the outside. The official repository's BSD-3-Clause license, discussed under [License](#license) below, is what actually governs redistribution here.)
This repository exists for two purposes:
1. To provide a directly downloadable mirror. The official training set is distributed as a 12-part split archive (`real_world.zip.00`–`.11`, ~44GB) that must be manually concatenated and unzipped — inconvenient for quick experimentation.
2. To provide a **subsampled** training set (6,385 of the official ~29,500 pairs, ~22%) sized for fast iteration on a single workstation GPU, while leaving the full official validation/test split (1,000 pairs) **untouched**, so evaluation numbers on this mirror's `val` split remain comparable to published results.
**Two-hop provenance.** This redistribution is not sourced directly from the official 44GB multi-part archive. It is sourced from a pre-subsampled copy whose directory layout and exact training-set size (6,385 pairs) match a Kaggle re-upload also called "SPA-Data" (`leftthomas/spadata`), which is referenced by name in some downstream repositories in the deraining literature. We were **not able to independently verify** that Kaggle listing's own stated license via automated retrieval while preparing this card — see [License](#license) below for what this mirror's terms are actually based on.
---
# Dataset Description
SPA-Data is a **real-world** (not synthetically rendered) single-image deraining benchmark, introduced alongside the SPANet architecture. The authors collected 170 real rain videos — 84 scenes captured on iPhones plus 86 scenes sourced from stock-footage libraries (StoryBlocks) and YouTube — and used a semi-automatic method combining temporal priors with human supervision to reconstruct a clean, rain-free reference frame for each rainy sequence, yielding strictly spatially-aligned rain/clean pairs. This is the standard reason SPA-Data is used as a **real-world generalization check** for models trained on synthetic rain (Rain13K, DDN-Data, etc.) — synthetic rain streaks don't fully capture the shape, direction, and intensity variation of real rain.
Officially: ~29.5K rain/rain-free training pairs, plus a held-out 1,000-pair test split.
This mirror: **6,385** training pairs (subsampled) + the **full 1,000-pair** official validation/test split.
---
# Changes from the Official Release
The transformation chain has two hops, each scoped narrowly:
### 1. Official 44GB archive → subsampled Kaggle-style copy (not performed by this repository)
An intermediate source (see [Disclaimer](#disclaimer)) subsampled the official ~29,500-pair training set down to 6,385 pairs. **We do not know the exact selection method used** (random subsample vs. scene-stratified — not documented anywhere we could find). If your use case is sensitive to sampling bias in the training set, be aware of this. The validation/test split was **not** subsampled — it retains all 1,000 official pairs.
### 2. Subsampled copy → this repository
- No images added, removed, or modified.
- No labels/pairings changed.
- No further subsampling — training set is redistributed exactly as received (6,385 pairs).
- Directory layout preserved as-is (`rgb_reconstruction/{rain,norain}` under `train/`/`val/`), since it already matches the naming convention documented in the official SPANet repo.
**Note on resolution:** `train/` images are 256×256 patches; `val/` images are 512×512 patches. This matches the crop convention used in the official release and is preserved unchanged.
---
# Dataset Structure
```text
spa-data/
├── README.md
├── banner.jpg
├── train/
│ └── rgb_reconstruction/
│ ├── rain/ # rain-{id}.png (6,385 images, 256x256)
│ └── norain/ # norain-{id}.png (6,385 images, 256x256)
└── val/
└── rgb_reconstruction/
├── rain/ # rain-{id}.png (1,000 images, 512x512)
└── norain/ # norain-{id}.png (1,000 images, 512x512)
```
Rain and clean images share a common numeric ID but different filename **prefixes** (`rain-{id}.png` / `norain-{id}.png`), not identical stems — this is why ClearView ships a dedicated `SPADataDataset` parser rather than relying on the generic `ImagePairDataset` (which expects exact-stem matches).
| Split | Pairs | Resolution | Size on disk |
|---|---|---|---|
| `train` | 6,385 | 256×256 | ~806 MB |
| `val` | 1,000 | 512×512 | ~451 MB |
| **Total** | **7,385** | — | **~1.3 GB** |
---
# Usage with ClearView
This dataset is designed to be used directly with [ClearView](https://github.com/dronefreak/clearview), an open-source PyTorch framework for image deraining.
```python
from huggingface_hub import snapshot_download
from clearview.data import SPADataDataset, get_train_transforms, get_val_transforms
data_dir = snapshot_download(repo_id="dronefreak/SPA-Data", repo_type="dataset")
train_ds = SPADataDataset(root_dir=data_dir, split="train", transform=get_train_transforms(crop_size=(256, 256)))
val_ds = SPADataDataset(root_dir=data_dir, split="val", transform=get_val_transforms())
rainy, clean = train_ds[0]
```
Or directly via the training CLI:
```bash
clearview-train \
--data-dir <path-to-downloaded-snapshot> \
--dataset-type spa-data --train-split train --val-split val \
--model restormer --batch-size 8 --crop-size 256 --epochs 100 \
--output-dir ./runs/spa_data_restormer
```
`SPADataDataset` auto-detects the `rgb_reconstruction/{rain,norain}` layout and matches pairs by numeric ID after stripping the `rain-`/`norain-` prefixes — no path overrides needed beyond `--train-split`/`--val-split`.
---
# Dataset Sources
## Original Paper
**Spatial Attentive Single-Image Deraining with a High Quality Real Rain Dataset**
Tianyu Wang, Xin Yang, Ke Xu, Shaozhe Chen, Qiang Zhang, Rynson W.H. Lau
IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
- **arXiv:** https://arxiv.org/abs/1904.01538
- **CVPR Open Access (PDF):** https://openaccess.thecvf.com/content_CVPR_2019/papers/Wang_Spatial_Attentive_Single-Image_Deraining_With_a_High_Quality_Real_Rain_CVPR_2019_paper.pdf
## Official Resources
- **Code + Dataset:** https://github.com/stevewongv/SPANet
- **Official train/test dataset READMEs:** [Train_Dataset_README.md](https://github.com/stevewongv/SPANet/blob/master/Train_Dataset_README.md), [Test_Datset_README.md](https://github.com/stevewongv/SPANet/blob/master/Test_Datset_README.md)
## Possible Intermediate Source (unverified)
- **Kaggle:** https://www.kaggle.com/datasets/leftthomas/spadata — directory layout and 6,385-pair training-set size match this mirror; license field could not be independently confirmed via automated retrieval while preparing this card.
---
# Attribution
**All credit for the dataset belongs entirely to the original authors: Tianyu Wang, Xin Yang, Ke Xu, Shaozhe Chen, Qiang Zhang, and Rynson W.H. Lau.**
If an intermediate Kaggle re-upload was in fact the direct source of this subsampled copy, credit for the subsampling also belongs to that contributor (see [above](#possible-intermediate-source-unverified)) — we could not fully confirm this chain, and note it here in the interest of transparency rather than certainty.
If you use this dataset in your research, **please cite the original publication below.**
---
# License
The official SPANet repository ships an explicit **BSD 3-Clause License** (`License.txt`), and its README states: *"If you use this code or our dataset (including test set), please cite"* the paper below — i.e. the dataset is explicitly covered by, and offered for use under, the same repository license as the code, with no non-commercial restriction and no access-request gate.
Key BSD-3-Clause conditions: redistributions must retain the copyright notice, the license conditions, and the disclaimer; the authors' names may not be used to endorse derived products without prior written permission; the software/data is provided with no warranty.
**A note on verification.** This determination is based on the *official* SPANet GitHub repository's license file, which we did retrieve and confirm directly. The possible intermediate Kaggle source's own stated license (if different) could not be independently confirmed — see [Dataset Sources](#dataset-sources). If you require certainty for commercial use, we recommend cross-checking the [official repository](https://github.com/stevewongv/SPANet/blob/master/License.txt) directly.
This repository is distributed under the same terms as the official source: **BSD-3-Clause**.
---
# Citation
If you use this dataset, please cite:
```bibtex
@InProceedings{Wang_2019_CVPR,
author = {Wang, Tianyu and Yang, Xin and Xu, Ke and Chen, Shaozhe and Zhang, Qiang and Lau, Rynson W.H.},
title = {Spatial Attentive Single-Image Deraining with a High Quality Real Rain Dataset},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}
```
---
# Acknowledgements
We sincerely thank Tianyu Wang, Xin Yang, Ke Xu, Shaozhe Chen, Qiang Zhang, and Rynson W.H. Lau for creating and publicly releasing this valuable real-world deraining benchmark, and the community contributor(s) behind the intermediate subsampled copy this repository redistributes.
|