ReCon1M / README.md
wliafe's picture
Add background class at index 0
457cdb3 verified
|
Raw
History Blame Contribute Delete
8.06 kB
---
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.