File size: 4,140 Bytes
0e26978
e589148
 
 
 
 
 
 
 
 
 
 
 
 
 
0e26978
e589148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9c22a4
 
ddfc64b
b9c22a4
 
 
 
 
 
 
 
e589148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-2.0
task_categories:
  - object-detection
tags:
  - scene-graph-generation
  - spatial-relations
  - negative-annotations
  - spatialsense
  - coco-format
language:
  - en
pretty_name: SpatialSense (COCO format)
size_categories:
  - 10K<n<100K
---

# SpatialSense (COCO format)

A mirror of **SpatialSense** (Yang, Russakovsky and Deng, *SpatialSense: An Adversarially
Crowdsourced Benchmark for Spatial Relation Recognition*, ICCV 2019), reformatted in the same
COCO-style schema as the other `maelic/*-coco-format` datasets. Every annotation states whether a
spatial predicate holds between a subject and an object, and the dataset is balanced: half the
relations are true and half are false.

It is used by axis A6 (spatial relations) of OV-SGG-Bench.

## Source and license

The authors' release is Zenodo record 8104370 (DOI
[10.5281/zenodo.8104370](https://doi.org/10.5281/zenodo.8104370)), published under **CC BY 2.0**;
this mirror keeps that license and attributes the authors. Images come from Flickr and the NYU
Depth dataset, as in the original release. The two source files were checked against the SHA-256
sums the record publishes (`annotations.json`
`ae8f613ff1886e27e06f154cc01393c8a86025ae7f8f3664a7fd2308d771bf39`, `images.tar.gz`
`1f9db2e56f323046aec301288a7e24bd35cce51f651cab93ea2e41dc27b853bd`).

## Samples

Four test images drawn at random (fixed seed) from the 22 that have at least three relations, both labels and at most five objects, with the boxes of every annotated subject and object; an object annotated twice with slightly different boxes appears twice. Green lines are relations labelled true, red lines relations labelled false.

<p>
<img src="https://huggingface.co/datasets/maelic/SpatialSense-coco-format/resolve/main/assets/sample_1.jpg" width="49%">
<img src="https://huggingface.co/datasets/maelic/SpatialSense-coco-format/resolve/main/assets/sample_2.jpg" width="49%">
<img src="https://huggingface.co/datasets/maelic/SpatialSense-coco-format/resolve/main/assets/sample_3.jpg" width="49%">
<img src="https://huggingface.co/datasets/maelic/SpatialSense-coco-format/resolve/main/assets/sample_4.jpg" width="49%">
</p>

## Contents

| Split | Images |
|---|---|
| train | 7,645 |
| validation | 1,553 |
| test | 2,371 |

11,569 images, 8,749 true and 8,749 false relations, 9 predicates (`above`, `behind`, `in`,
`in front of`, `next to`, `on`, `to the left of`, `to the right of`, `under`) and 3,679 free-text
object names. `categories.json` holds `categories` (the index used by `category_id`) and
`predicates` (the index used by `predicate_id`), both sorted alphabetically.

| Field | Description |
|---|---|
| `image` | original bytes (Flickr JPEG or NYU PNG) |
| `image_id` | index of the image in the source `annotations.json` |
| `width`, `height`, `file_name`, `url`, `nsid` | as in the source; `file_name` is the path inside `images.tar.gz` |
| `objects` | subjects and objects deduplicated by (name, box): `id`, `bbox` (COCO `[x, y, w, h]`, pixels), `category_id`, `area`, `iscrowd` |
| `relations` | relations labelled **true**: `id`, `annotation_id` (the source `_id`), `subject_id`, `object_id` (indices into `objects`), `predicate_id`, `subject_point`, `object_point` (the `[x, y]` points the annotator clicked) |
| `neg_relations` | relations labelled **false**, same fields |

## Changes from the source

All mechanical: boxes converted from SpatialSense's `[y_min, y_max, x_min, x_max]` to COCO
`[x, y, w, h]`; objects deduplicated per image; the `label` field turned into the
`relations` / `neg_relations` split; macOS `._*` files from the archive skipped; images stored
with their original bytes. A random sample of 50 images was checked against the source.

## Citation

```bibtex
@inproceedings{yang2019spatialsense,
  title     = {SpatialSense: An Adversarially Crowdsourced Benchmark for Spatial Relation Recognition},
  author    = {Yang, Kaiyu and Russakovsky, Olga and Deng, Jia},
  booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
  pages     = {2051--2060},
  year      = {2019},
  doi       = {10.1109/ICCV.2019.00214}
}
```