wliafe commited on
Commit
341d64f
·
verified ·
1 Parent(s): fdb445b

Document the ReCon1M dataset

Browse files

Document schema, image path resolution, splits, source ID remapping, and citation while preserving the generated YAML front matter (SHA-256: 63ad10bc99e3a7c4fe247126f74de7f0823b431f397587989c1fde8fd092bc89).

Files changed (1) hide show
  1. README.md +121 -0
README.md CHANGED
@@ -176,3 +176,124 @@ configs:
176
  - split: test
177
  path: data/test-*
178
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  - split: test
177
  path: data/test-*
178
  ---
179
+
180
+
181
+ # ReCon1M
182
+
183
+ ReCon1M is a remote-sensing scene graph generation dataset derived from
184
+ FAIR1M. This repository packages the local release as structured Hugging Face
185
+ Parquet annotations while keeping PNG images as ordinary repository files.
186
+
187
+ The packaged release contains **22,262 images**,
188
+ **60 object classes**, and
189
+ **59 predicate classes**:
190
+
191
+ | Split | Images |
192
+ | --- | ---: |
193
+ | `train` | 11,131 |
194
+ | `validation` | 3,710 |
195
+ | `test` | 7,421 |
196
+
197
+ These counts describe the files in this packaged release. They differ from the
198
+ counts in the paper abstract, which may describe another ReCon1M release.
199
+
200
+ ## Repository layout
201
+
202
+ ```text
203
+ images/<split>/<first-two-ID-characters>/<id>.png
204
+ data/...
205
+ README.md
206
+ ```
207
+
208
+ The `image` column is a POSIX repository-relative path such as
209
+ `images/train/09/09868.png`. It contains neither image bytes nor an automatic
210
+ Pillow object. Most images use `.png`; the three JPEG-encoded source images use
211
+ their corrected `.jpeg` filenames: `00024.jpeg`, `00033.jpeg`, and
212
+ `00037.jpeg`.
213
+
214
+ ## Schema
215
+
216
+ - `id`: original zero-padded image identifier.
217
+ - `image`: repository-relative PNG path.
218
+ - `width`, `height`: PNG dimensions.
219
+ - `image_source`, `gsd`: metadata from the object annotation header.
220
+ - `polygons`: one four-point polygon per object. Coordinates and vertex order
221
+ are preserved; polygons are not converted to bounding boxes.
222
+ - `labels`: object `ClassLabel` values.
223
+ - `difficult`: original per-object difficulty integers.
224
+ - `relations.subject_index`, `relations.object_index`: zero-based indices into
225
+ `labels` and `polygons`.
226
+ - `relations.predicate`: predicate `ClassLabel` values.
227
+
228
+ The source object and predicate vocabularies use one-based IDs. This package
229
+ maps them to zero-based Hugging Face `ClassLabel` indices without changing
230
+ their vocabulary order. No `attributes` field is added.
231
+
232
+ ## Download and open images
233
+
234
+ Install `datasets`, `huggingface_hub`, and Pillow, then download the repository
235
+ snapshot and load its Parquet annotations:
236
+
237
+ ```python
238
+ from pathlib import Path
239
+
240
+ from datasets import load_dataset
241
+ from huggingface_hub import snapshot_download
242
+ from PIL import Image
243
+
244
+
245
+ repo_dir = Path(snapshot_download("wliafe/recon1m", repo_type="dataset"))
246
+ dataset = load_dataset("wliafe/recon1m")
247
+
248
+ sample = dataset["train"][0]
249
+ image_path = repo_dir / sample["image"]
250
+
251
+ with Image.open(image_path) as image:
252
+ image.load()
253
+ print(image.size)
254
+ ```
255
+
256
+ OpenCV can read the same resolved path:
257
+
258
+ ```python
259
+ import cv2
260
+
261
+
262
+ image_bgr = cv2.imread(str(image_path), cv2.IMREAD_COLOR)
263
+ if image_bgr is None:
264
+ raise RuntimeError(f"Failed to read {image_path}")
265
+ ```
266
+
267
+ The complete snapshot includes roughly 32.6 GB of PNG files. Calling only
268
+ `load_dataset()` downloads the Parquet annotations, not all image files.
269
+
270
+ For reproducible loading, pass the same revision to both calls:
271
+
272
+ ```python
273
+ revision = "<commit-sha>"
274
+ repo_dir = Path(
275
+ snapshot_download(
276
+ "wliafe/recon1m",
277
+ repo_type="dataset",
278
+ revision=revision,
279
+ )
280
+ )
281
+ dataset = load_dataset("wliafe/recon1m", revision=revision)
282
+ ```
283
+
284
+ ## Citation
285
+
286
+ If you use ReCon1M, cite the original paper:
287
+
288
+ ```bibtex
289
+ @article{sun2024recon1m,
290
+ title={ReCon1M: A Large-scale Benchmark Dataset for Relation Comprehension in Remote Sensing Imagery},
291
+ author={Sun, Xian and Yan, Qiwei and Deng, Chubo and Liu, Chenglong and Jiang, Yi and Hou, Zhongyan and Lu, Wanxuan and Yao, Fanglong and Liu, Xiaoyu and Hao, Lingxiang and Yu, Hongfeng},
292
+ journal={arXiv preprint arXiv:2406.06028},
293
+ year={2024}
294
+ }
295
+ ```
296
+
297
+ See the [ReCon1M paper](https://arxiv.org/abs/2406.06028) for the dataset
298
+ methodology. Use of the images and annotations remains subject to the terms of
299
+ the original ReCon1M and FAIR1M releases.