Datasets:
Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115---license: cc-by-4.0task_categories: - image-to-imagetags: - remote-sensing - cloud-removal - SAR - sentinelpretty_name: SEN12MS-CRsize_categories: - 100K<n<1Mconfigs: - config_name: default data_files: - split: train path: - "spring/*.parquet" - "summer/*.parquet" - "fall/*.parquet" - "winter/*.parquet" default: true---
# SEN12MS-CR
Reorganized mirror of the [SEN12MS-CR dataset](https://mediatum.ub.tum.de/1554803) in Parquet format.
## Quick Start
```pythonfrom datasets import load_datasetimport numpy as np
# Streaming:ds = load_dataset("Hermanni/sen12mscr", streaming=True)for sample in ds["train"]: sar = np.frombuffer(sample["sar"], dtype=sample["dtype"]).reshape(sample["sar_shape"]) # (2, 256, 256) cloudy = np.frombuffer(sample["cloudy"], dtype=sample["dtype"]).reshape(sample["opt_shape"]) # (13, 256, 256) target = np.frombuffer(sample["target"], dtype=sample["dtype"]).reshape(sample["opt_shape"]) # (13, 256, 256)
# Full download:ds = load_dataset("Hermanni/sen12mscr")
# Filter by season:ds = load_dataset("Hermanni/sen12mscr", data_files="spring/*.parquet")```
### PyTorch (true random shuffle)
```pythonfrom torch.utils.data import Dataset, DataLoaderfrom datasets import load_datasetimport numpy as np, torch
class SEN12MSCR(Dataset): def __init__(self, hf_dataset, normalize=True): self.ds = hf_dataset self.normalize = normalize def __len__(self): return len(self.ds) def __getitem__(self, idx): s = self.ds[idx] dt = np.dtype(s["dtype"]) sar = torch.from_numpy(np.frombuffer(s["sar"], dtype=dt).reshape(s["sar_shape"]).astype(np.float32).copy()) cloudy = torch.from_numpy(np.frombuffer(s["cloudy"], dtype=dt).reshape(s["opt_shape"]).astype(np.float32).copy()) target = torch.from_numpy(np.frombuffer(s["target"], dtype=dt).reshape(s["opt_shape"]).astype(np.float32).copy()) if self.normalize: cloudy /= 10000.0; target /= 10000.0 return {"sar": sar, "cloudy": cloudy, "target": target}
ds = load_dataset("Hermanni/sen12mscr", split="train")loader = DataLoader(SEN12MSCR(ds), batch_size=8, shuffle=True, num_workers=4)```
> Public dataset. No token required.
## Contents- **~122,218** triplets (256x256, int16)- **SAR**: Sentinel-1 (2ch: VV, VH)- **Cloudy**: Sentinel-2 (13ch, cloud-contaminated)- **Target**: Sentinel-2 (13ch, cloud-free GT)- 4 seasons, 175 global ROIs (2018)
## Columns
| Column | Type | Description ||---|---|---|| `sar` | binary | SAR bytes, reshape with `sar_shape` || `cloudy` | binary | Cloudy S2, reshape with `opt_shape` || `target` | binary | Cloud-free S2, reshape with `opt_shape` || `sar_shape` | list[int] | [2, 256, 256] || `opt_shape` | list[int] | [13, 256, 256] || `dtype` | string | "int16" || `season` | string | spring/summer/fall/winter || `scene` | string | Scene number || `patch` | string | Patch ID |
## Train/Val/Test SplitNot pre-split. Use DSen2-CR's `datasetfilelist.csv` (149/10/10 ROI split):https://github.com/ameraner/dsen2-cr
## License[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
## Citation```bibtex@article{meraner2020cloud, title={Cloud removal in Sentinel-2 imagery using a deep residual neural network and SAR-optical data fusion}, author={Meraner, Andrea and Ebel, Patrick and Zhu, Xiao Xiang and Schmitt, Michael}, journal={ISPRS Journal of Photogrammetry and Remote Sensing}, volume={166}, pages={333--346}, year={2020}}```
## Source- [mediaTUM (ID: 1554803)](https://mediatum.ub.tum.de/1554803)README.mdAdded+115