File size: 5,935 Bytes
12aeb61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ecdea8
 
 
 
 
 
12aeb61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ecdea8
12aeb61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-4.0
task_categories:
  - visual-question-answering
language:
  - en
tags:
  - clevr
  - compositional-reasoning
  - synthetic
  - scene-graphs
size_categories:
  - n<1K
pretty_name: CLEVR Sample 500
---

# CLEVR Sample 500

A small, aligned subset of [CLEVR v1.0](https://cs.stanford.edu/people/jcjohns/clevr/) for fast end-to-end visual question answering experiments. It contains images and questions for training, validation, and test workflows, plus the scene graphs and labels released for the training and validation splits.

This is a deterministic subset of CLEVR v1.0, not a new or official CLEVR release.

## Dataset summary

| Split | Images | Questions | Scene graphs | Answers and programs |
| --- | ---: | ---: | ---: | --- |
| Train | 500 | 5,000 | 500 | Yes |
| Validation | 107 | 1,070 | 107 | Yes |
| Test | 107 | 1,070 | Not released | No |
| **Total** | **714** | **7,140** | **607** | — |

## No-install viewer

To browse the sample without installing anything, download or clone the **complete** dataset repository, then double-click `viewer.html`. The viewer lets you choose the train, validation, or test split; move to previous or next images; jump to an image index; choose a random image; search question text; show or hide answers; inspect functional programs and scene details; and turn on numbered object overlays when available.

Keep `viewer.html` beside the repository's `images/` directory, including `images/train/`, `images/val/`, and `images/test/`. Opening `viewer.html` by itself, without these adjacent image folders and their PNG files, will not display images.

The validation and test counts preserve the approximate image ratio of the full dataset: 70,000 training images to 15,000 validation images to 15,000 test images. Scaling that ratio from 500 training images gives 107 images for each evaluation split.

## Subset construction

The sample uses a reproducible prefix selection based on the original `image_index`:

- Train: indices `0` through `499`
- Validation: indices `0` through `106`
- Test: indices `0` through `106`

Questions and scene graphs were filtered by the same indices. Original filenames, image indices, question indices, annotations, answers, and functional programs are unchanged; nothing is renumbered.

## Repository structure

```text
.
├── viewer.html                # No-install dataset viewer
├── images
│   ├── train/                  # 500 PNG files
│   ├── val/                    # 107 PNG files
│   └── test/                   # 107 PNG files
├── questions
│   ├── CLEVR_train_questions.json
│   ├── CLEVR_val_questions.json
│   └── CLEVR_test_questions.json
├── scenes
│   ├── CLEVR_train_scenes.json
│   └── CLEVR_val_scenes.json
├── COPYRIGHT.txt
├── LICENSE.txt
└── README.txt                  # Original CLEVR format documentation
```

## Annotation format

Each question file contains an `info` object and a `questions` array. Every question includes:

- `split`
- `image_index`
- `image_filename`
- `question`
- `question_index`

Training and validation questions additionally include `answer`, `program`, and `question_family_index`. As in the original release, test answers and functional programs are not provided.

Training and validation scene files contain an `info` object and a `scenes` array. Each scene describes object attributes, 3D and pixel coordinates, camera-relative directions, and spatial relationships. The original CLEVR release does not provide test scene graphs.

## Loading the dataset

Download a Hugging Face repository snapshot, then join annotations to images using `image_filename`:

```python
import json
from pathlib import Path

from huggingface_hub import snapshot_download
from PIL import Image

root = Path(
    snapshot_download(
        repo_id="YOUR_NAMESPACE/CLEVR_sample_500",
        repo_type="dataset",
    )
)

with (root / "questions" / "CLEVR_train_questions.json").open() as file:
    questions = json.load(file)["questions"]

example = questions[0]
image = Image.open(root / "images" / "train" / example["image_filename"])
print(example["question"], example["answer"], image.size)
```

Use `CLEVR_val_questions.json` and `images/val` for validation. Test examples have questions but no ground-truth answers.

## Intended use and limitations

This sample is intended for pipeline development, smoke tests, debugging, and fast iteration. It is too small for reproducing full-dataset CLEVR results or making reliable model comparisons.

Because selection uses the first image indices rather than random or stratified sampling, the subset should not be assumed to preserve the full distribution of object combinations, question families, or answers. Results on this sample are not directly comparable with published results on the complete CLEVR benchmark.

CLEVR is synthetic and measures specific forms of visual and compositional reasoning. It does not represent the visual or linguistic diversity of real-world applications.

## Source, license, and citation

The files are derived from the official [CLEVR v1.0 dataset](https://dl.fbaipublicfiles.com/clevr/CLEVR_v1.0.zip). The dataset metadata and included license identify the license as [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/). See `LICENSE.txt` and `COPYRIGHT.txt` for the bundled terms and attribution notice.

If you use this subset, cite the original CLEVR paper:

```bibtex
@inproceedings{johnson2017clevr,
  title={CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning},
  author={Johnson, Justin and Hariharan, Bharath and van der Maaten, Laurens and Fei-Fei, Li and Zitnick, C. Lawrence and Girshick, Ross},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2017}
}
```