Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,11 +14,9 @@ size_categories:
|
|
| 14 |
|
| 15 |
## 🚧 Dataset Upload in Progress
|
| 16 |
|
| 17 |
-
GeoSR-Bench is currently being uploaded and reorganized.
|
| 18 |
|
| 19 |
-
Some files, metadata, and subsets may still be incomplete or subject to change.
|
| 20 |
-
|
| 21 |
-
---
|
| 22 |
|
| 23 |
## Dataset Description
|
| 24 |
|
|
@@ -53,136 +51,150 @@ The dataset contains both SR-only datasets and downstream task datasets.
|
|
| 53 |
|
| 54 |
```text
|
| 55 |
SRDatasetName/
|
| 56 |
-
├──
|
| 57 |
-
│ ├──
|
| 58 |
-
│ ├──
|
| 59 |
│ └── ...
|
| 60 |
-
├──
|
| 61 |
-
│ ├──
|
| 62 |
-
│ ├──
|
| 63 |
│ └── ...
|
| 64 |
-
├──
|
| 65 |
-
│ ├──
|
| 66 |
-
│ ├──
|
| 67 |
│ └── ...
|
| 68 |
-
└──
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
```
|
| 70 |
|
| 71 |
### Downstream task dataset
|
| 72 |
|
| 73 |
```text
|
| 74 |
DownstreamDatasetName/
|
| 75 |
-
├──
|
| 76 |
-
│ ├──
|
| 77 |
-
│ ├──
|
| 78 |
-
│ └── .
|
| 79 |
-
├──
|
| 80 |
-
│ ├──
|
| 81 |
-
│ ├──
|
| 82 |
-
│ └── .
|
| 83 |
-
├──
|
| 84 |
-
│ ├──
|
| 85 |
-
│ ├──
|
| 86 |
-
│ └── .
|
| 87 |
-
|
| 88 |
-
│ ├── meta_0.json
|
| 89 |
-
│ ├── meta_1.json
|
| 90 |
-
│ └── ...
|
| 91 |
-
└── DownstreamDatasetName_split_all.csv
|
| 92 |
```
|
| 93 |
|
| 94 |
-
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
|
| 99 |
|
| 100 |
-
|
| 101 |
|
| 102 |
-
|
| 103 |
-
LR image,HR image,Label,split
|
| 104 |
-
DownstreamDatasetName/s2/s2_0.tif,DownstreamDatasetName/naip/naip_0.tif,DownstreamDatasetName/label/label_0.tif,training
|
| 105 |
-
DownstreamDatasetName/s2/s2_1.tif,DownstreamDatasetName/naip/naip_1.tif,DownstreamDatasetName/label/label_1.tif,validation
|
| 106 |
-
DownstreamDatasetName/s2/s2_2.tif,DownstreamDatasetName/naip/naip_2.tif,DownstreamDatasetName/label/label_2.tif,test
|
| 107 |
-
```
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
-
|
| 111 |
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
| `LR image` | Path to the lower-resolution input image |
|
| 115 |
-
| `HR image` | Path to the higher-resolution reference image |
|
| 116 |
-
| `Label` | Path to the downstream task label |
|
| 117 |
-
| `split` | Dataset split: `training`, `validation`, or `test` |
|
| 118 |
|
| 119 |
-
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
- Split files are stored as CSV files (`.csv`).
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
-
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
-
|
| 131 |
|
| 132 |
```python
|
|
|
|
|
|
|
| 133 |
import pandas as pd
|
|
|
|
| 134 |
|
| 135 |
-
|
| 136 |
-
df = pd.read_csv(csv_path)
|
| 137 |
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
test_df = df[df["split"] == "test"]
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
|
|
|
| 144 |
|
| 145 |
-
|
|
|
|
|
|
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
|
|
|
| 149 |
|
| 150 |
-
|
| 151 |
-
hr_path = sample["HR image"]
|
| 152 |
|
| 153 |
-
print(
|
| 154 |
-
print(
|
|
|
|
| 155 |
```
|
| 156 |
|
| 157 |
-
|
| 158 |
|
| 159 |
```python
|
| 160 |
-
|
|
|
|
| 161 |
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
print(label_path)
|
| 169 |
-
```
|
| 170 |
|
| 171 |
-
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
with rasterio.open("DownstreamDatasetName/s2/s2_0.tif") as src:
|
| 177 |
-
image = src.read()
|
| 178 |
-
crs = src.crs
|
| 179 |
-
transform = src.transform
|
| 180 |
-
|
| 181 |
-
print(image.shape)
|
| 182 |
-
print(crs)
|
| 183 |
-
print(transform)
|
| 184 |
```
|
| 185 |
|
|
|
|
| 186 |
## Intended Use
|
| 187 |
|
| 188 |
This dataset is intended for research on:
|
|
|
|
| 14 |
|
| 15 |
## 🚧 Dataset Upload in Progress
|
| 16 |
|
| 17 |
+
The GeoSR-Bench dataset is currently being uploaded and reorganized.
|
| 18 |
|
| 19 |
+
Some files, metadata, and subsets may still be incomplete or subject to change during the upload process.
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Dataset Description
|
| 22 |
|
|
|
|
| 51 |
|
| 52 |
```text
|
| 53 |
SRDatasetName/
|
| 54 |
+
├── train/
|
| 55 |
+
│ ├── SRDatasetName_train_part_0000.parquet
|
| 56 |
+
│ ├── SRDatasetName_train_part_0001.parquet
|
| 57 |
│ └── ...
|
| 58 |
+
├── val/
|
| 59 |
+
│ ├── SRDatasetName_val_part_0000.parquet
|
| 60 |
+
│ ├── SRDatasetName_val_part_0001.parquet
|
| 61 |
│ └── ...
|
| 62 |
+
├── test/
|
| 63 |
+
│ ├── SRDatasetName_test_part_0000.parquet
|
| 64 |
+
│ ├── SRDatasetName_test_part_0001.parquet
|
| 65 |
│ └── ...
|
| 66 |
+
└── index.csv
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Each Parquet file contains paired low-resolution and high-resolution images together with metadata:
|
| 70 |
+
|
| 71 |
+
```text
|
| 72 |
+
id
|
| 73 |
+
lr_name
|
| 74 |
+
hr_name
|
| 75 |
+
lr_image
|
| 76 |
+
hr_image
|
| 77 |
+
meta
|
| 78 |
```
|
| 79 |
|
| 80 |
### Downstream task dataset
|
| 81 |
|
| 82 |
```text
|
| 83 |
DownstreamDatasetName/
|
| 84 |
+
├── train/
|
| 85 |
+
│ ├── DownstreamDatasetName_train_part_0000.parquet
|
| 86 |
+
│ ├── DownstreamDatasetName_train_part_0001.parquet
|
| 87 |
+
│ └── DownstreamDatasetName_train_index.csv
|
| 88 |
+
├── val/
|
| 89 |
+
│ ├── DownstreamDatasetName_val_part_0000.parquet
|
| 90 |
+
│ ├── DownstreamDatasetName_val_part_0001.parquet
|
| 91 |
+
│ └── DownstreamDatasetName_val_index.csv
|
| 92 |
+
├── test/
|
| 93 |
+
│ ├── DownstreamDatasetName_test_part_0000.parquet
|
| 94 |
+
│ ├── DownstreamDatasetName_test_part_0001.parquet
|
| 95 |
+
│ └── DownstreamDatasetName_test_index.csv
|
| 96 |
+
└── index.csv
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
```
|
| 98 |
|
| 99 |
+
Each Parquet file contains paired images, labels, and metadata:
|
| 100 |
|
| 101 |
+
```text
|
| 102 |
+
id
|
| 103 |
+
lr_name
|
| 104 |
+
hr_name
|
| 105 |
+
label_name
|
| 106 |
+
meta_name
|
| 107 |
+
lr_image
|
| 108 |
+
hr_image
|
| 109 |
+
label_image
|
| 110 |
+
meta
|
| 111 |
+
```
|
| 112 |
|
| 113 |
+
## Loading Images and Labels
|
| 114 |
|
| 115 |
+
Images and labels are stored as binary GeoTIFF bytes inside each Parquet file. They can be read directly with `rasterio`.
|
| 116 |
|
| 117 |
+
### Load an SR-only sample
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
+
```python
|
| 120 |
+
import io
|
| 121 |
+
import json
|
| 122 |
+
import pandas as pd
|
| 123 |
+
import rasterio
|
| 124 |
|
| 125 |
+
parquet_path = "Sentinel2_to_NAIP\SR_Dataset\data\sentinel2_to_naip_part_0000.parquet"
|
| 126 |
|
| 127 |
+
df = pd.read_parquet(parquet_path)
|
| 128 |
+
sample = df.iloc[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
+
with rasterio.open(io.BytesIO(sample["lr_image"])) as src:
|
| 131 |
+
lr = src.read()
|
| 132 |
+
lr_profile = src.profile
|
| 133 |
|
| 134 |
+
with rasterio.open(io.BytesIO(sample["hr_image"])) as src:
|
| 135 |
+
hr = src.read()
|
| 136 |
+
hr_profile = src.profile
|
|
|
|
| 137 |
|
| 138 |
+
meta = json.loads(sample["meta"]) if sample["meta"] is not None else None
|
| 139 |
|
| 140 |
+
print(sample["id"])
|
| 141 |
+
print(lr.shape, hr.shape)
|
| 142 |
+
print(meta)
|
| 143 |
+
```
|
| 144 |
|
| 145 |
+
### Load a downstream task sample
|
| 146 |
|
| 147 |
```python
|
| 148 |
+
import io
|
| 149 |
+
import json
|
| 150 |
import pandas as pd
|
| 151 |
+
import rasterio
|
| 152 |
|
| 153 |
+
parquet_path = "Sentinel2_to_NAIP/Downstream_Datasets/RoadDetection/train/road_detection_train_part_0000.parquet"
|
|
|
|
| 154 |
|
| 155 |
+
df = pd.read_parquet(parquet_path)
|
| 156 |
+
sample = df.iloc[0]
|
|
|
|
| 157 |
|
| 158 |
+
with rasterio.open(io.BytesIO(sample["lr_image"])) as src:
|
| 159 |
+
lr = src.read()
|
| 160 |
+
lr_profile = src.profile
|
| 161 |
|
| 162 |
+
with rasterio.open(io.BytesIO(sample["hr_image"])) as src:
|
| 163 |
+
hr = src.read()
|
| 164 |
+
hr_profile = src.profile
|
| 165 |
|
| 166 |
+
with rasterio.open(io.BytesIO(sample["label_image"])) as src:
|
| 167 |
+
label = src.read()
|
| 168 |
+
label_profile = src.profile
|
| 169 |
|
| 170 |
+
meta = json.loads(sample["meta"]) if sample["meta"] is not None else None
|
|
|
|
| 171 |
|
| 172 |
+
print(sample["id"])
|
| 173 |
+
print(lr.shape, hr.shape, label.shape)
|
| 174 |
+
print(meta)
|
| 175 |
```
|
| 176 |
|
| 177 |
+
### Convert a sample back to GeoTIFF files
|
| 178 |
|
| 179 |
```python
|
| 180 |
+
from pathlib import Path
|
| 181 |
+
import pandas as pd
|
| 182 |
|
| 183 |
+
parquet_path = "Sentinel2_to_NAIP/Downstream_Datasets/RoadDetection/train/road_detection_train_part_0000.parquet"
|
| 184 |
+
out_dir = Path("recovered_sample")
|
| 185 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 186 |
|
| 187 |
+
df = pd.read_parquet(parquet_path)
|
| 188 |
+
sample = df.iloc[0]
|
|
|
|
|
|
|
| 189 |
|
| 190 |
+
(out_dir / sample["lr_name"]).write_bytes(sample["lr_image"])
|
| 191 |
+
(out_dir / sample["hr_name"]).write_bytes(sample["hr_image"])
|
| 192 |
|
| 193 |
+
if "label_image" in sample:
|
| 194 |
+
(out_dir / sample["label_name"]).write_bytes(sample["label_image"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
```
|
| 196 |
|
| 197 |
+
|
| 198 |
## Intended Use
|
| 199 |
|
| 200 |
This dataset is intended for research on:
|