File size: 8,064 Bytes
fdb445b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457cdb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fdb445b
 
 
 
 
 
 
 
 
 
 
 
457cdb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fdb445b
 
 
 
 
 
 
 
 
 
457cdb3
fdb445b
 
 
 
 
 
 
 
 
 
 
341d64f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
---
dataset_info:
  features:
  - name: id
    dtype: string
  - name: image
    dtype: string
  - name: width
    dtype: int32
  - name: height
    dtype: int32
  - name: image_source
    dtype: string
  - name: gsd
    dtype: float32
  - name: polygons
    list:
      list:
        list: float32
        length: 2
      length: 4
  - name: labels
    list:
      class_label:
        names:
          '0': __background__
          '1': van
          '2': small-car
          '3': building
          '4': road
          '5': airplane
          '6': block
          '7': parking-lot
          '8': motorboat
          '9': dump-truck
          '10': cargo-truck
          '11': dry-cargo-ship
          '12': runway
          '13': container
          '14': water
          '15': intersection
          '16': fishing-boat
          '17': other-vehicle
          '18': storage-tank
          '19': airport
          '20': other-ship
          '21': harbor
          '22': solar-panel
          '23': pool
          '24': tennis-court
          '25': engineering-ship
          '26': crane
          '27': liquid-cargo-ship
          '28': bus
          '29': passenger-ship
          '30': warship
          '31': excavator
          '32': storage-tank-group
          '33': bridge
          '34': basketball-court
          '35': trailer
          '36': tugboat
          '37': train-carriage
          '38': football-field
          '39': cargo
          '40': baseball-field
          '41': boarding_bridge
          '42': greenbelt
          '43': exhaust-fan
          '44': truck-tractor
          '45': factory
          '46': construction-site
          '47': roundabout
          '48': terminal
          '49': tractor
          '50': railway
          '51': farmland
          '52': stadium
          '53': chimney
          '54': gas-station
          '55': dam
          '56': locomotive
          '57': expressway-service-area
          '58': control-tower
          '59': smoke
          '60': helicopter-apron
  - name: difficult
    list: int8
  - name: relations
    struct:
    - name: subject_index
      list: int64
    - name: object_index
      list: int64
    - name: predicate
      list:
        class_label:
          names:
            '0': __background__
            '1': parked-at
            '2': park-next-to
            '3': close-to
            '4': provide-access-to
            '5': inside
            '6': drive-on
            '7': moor-at
            '8': serve
            '9': is-parallel-to
            '10': adjacent-to
            '11': belong-to
            '12': sail-on
            '13': pile-up-at
            '14': cross
            '15': supplement
            '16': slow-down
            '17': taxi-on
            '18': supply
            '19': cooperate-with
            '20': contain
            '21': power
            '22': link-to
            '23': prepared-for
            '24': support
            '25': hoist
            '26': above
            '27': drive-at-the-different-lane
            '28': dock-at
            '29': connect
            '30': drive-at-the-same-lane
            '31': border
            '32': equipped-with
            '33': separate
            '34': ventilate
            '35': transport
            '36': support-the-construction-of
            '37': manage
            '38': placed-on
            '39': sail-by
            '40': lie-under
            '41': park-alone-at
            '42': cultivate
            '43': converge
            '44': tow
            '45': provide-shuttle-service-to
            '46': around
            '47': move-away-from
            '48': exit-from
            '49': enter
            '50': adjoint-with
            '51': dock-alone-at
            '52': load
            '53': command
            '54': is-symmetric-with
            '55': block
            '56': emit
            '57': pass-under
            '58': dig
            '59': pull
  splits:
  - name: train
    num_bytes: 36252246
    num_examples: 11131
  - name: validation
    num_bytes: 12006883
    num_examples: 3710
  - name: test
    num_bytes: 24525738
    num_examples: 7421
  download_size: 75910965
  dataset_size: 72784867
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
---


# ReCon1M

ReCon1M is a remote-sensing scene graph generation dataset derived from
FAIR1M. This repository packages the local release as structured Hugging Face
Parquet annotations while keeping PNG images as ordinary repository files.

The packaged release contains **22,262 images**,
**60 object classes**, and
**59 predicate classes**:

| Split | Images |
| --- | ---: |
| `train` | 11,131 |
| `validation` | 3,710 |
| `test` | 7,421 |

These counts describe the files in this packaged release. They differ from the
counts in the paper abstract, which may describe another ReCon1M release.

## Repository layout

```text
images/<split>/<first-two-ID-characters>/<id>.png
data/...
README.md
```

The `image` column is a POSIX repository-relative path such as
`images/train/09/09868.png`. It contains neither image bytes nor an automatic
Pillow object. Most images use `.png`; the three JPEG-encoded source images use
their corrected `.jpeg` filenames: `00024.jpeg`, `00033.jpeg`, and
`00037.jpeg`.

## Schema

- `id`: original zero-padded image identifier.
- `image`: repository-relative PNG path.
- `width`, `height`: PNG dimensions.
- `image_source`, `gsd`: metadata from the object annotation header.
- `polygons`: one four-point polygon per object. Coordinates and vertex order
  are preserved; polygons are not converted to bounding boxes.
- `labels`: object `ClassLabel` values.
- `difficult`: original per-object difficulty integers.
- `relations.subject_index`, `relations.object_index`: zero-based indices into
  `labels` and `polygons`.
- `relations.predicate`: predicate `ClassLabel` values.

The source object and predicate vocabularies use one-based IDs. This package
maps them to zero-based Hugging Face `ClassLabel` indices without changing
their vocabulary order. No `attributes` field is added.

## Download and open images

Install `datasets`, `huggingface_hub`, and Pillow, then download the repository
snapshot and load its Parquet annotations:

```python
from pathlib import Path

from datasets import load_dataset
from huggingface_hub import snapshot_download
from PIL import Image


repo_dir = Path(snapshot_download("wliafe/recon1m", repo_type="dataset"))
dataset = load_dataset("wliafe/recon1m")

sample = dataset["train"][0]
image_path = repo_dir / sample["image"]

with Image.open(image_path) as image:
    image.load()
    print(image.size)
```

OpenCV can read the same resolved path:

```python
import cv2


image_bgr = cv2.imread(str(image_path), cv2.IMREAD_COLOR)
if image_bgr is None:
    raise RuntimeError(f"Failed to read {image_path}")
```

The complete snapshot includes roughly 32.6 GB of PNG files. Calling only
`load_dataset()` downloads the Parquet annotations, not all image files.

For reproducible loading, pass the same revision to both calls:

```python
revision = "<commit-sha>"
repo_dir = Path(
    snapshot_download(
        "wliafe/recon1m",
        repo_type="dataset",
        revision=revision,
    )
)
dataset = load_dataset("wliafe/recon1m", revision=revision)
```

## Citation

If you use ReCon1M, cite the original paper:

```bibtex
@article{sun2024recon1m,
  title={ReCon1M: A Large-scale Benchmark Dataset for Relation Comprehension in Remote Sensing Imagery},
  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},
  journal={arXiv preprint arXiv:2406.06028},
  year={2024}
}
```

See the [ReCon1M paper](https://arxiv.org/abs/2406.06028) for the dataset
methodology. Use of the images and annotations remains subject to the terms of
the original ReCon1M and FAIR1M releases.