Datasets:
Publish deduplicated VQA questions, preview, and upload status
Browse files- .gitattributes +1 -0
- README.md +109 -52
- README_ZH.md +151 -0
- assets/dataset-logo.png +3 -0
- assets/rl-mind-logo.png +0 -0
.gitattributes
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 1 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
assets/dataset-logo.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -35,91 +35,148 @@ configs:
|
|
| 35 |
> **Upload in progress:** this release is incomplete until all 180 original-resolution image shards listed in `provenance/image_shards.sha256.jsonl` are present and verified. Each source image is stored once. The `preview` configuration contains browsing thumbnails only.
|
| 36 |
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|---|---|---|
|
| 44 |
-
| `questions`(默认) | `unsplit` | 1,563 条问答、按顺序排列的 `image_ids` 及原始标注字段 |
|
| 45 |
-
| `images` | `unsplit` | 854 张按 SHA-256 去重的原始图片,每行一张,主键 `image_id`、图片列 `image` |
|
| 46 |
-
| `preview` | `sample` | 8 条展示样例,每类任务一条,使用派生缩略图 |
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
##
|
| 51 |
|
| 52 |
-
|
| 53 |
|
| 54 |
```python
|
| 55 |
-
from datasets import
|
| 56 |
|
| 57 |
REPO = "RL-MIND/NJU-HARD"
|
| 58 |
questions = load_dataset(REPO, "questions", split="unsplit")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
images = load_dataset(REPO, "images", split="unsplit")
|
| 60 |
images = images.cast_column("image", Image(decode=False))
|
| 61 |
|
| 62 |
-
#
|
| 63 |
id_to_row = {image_id: i for i, image_id in enumerate(images["image_id"])}
|
| 64 |
question = questions[0]
|
| 65 |
-
print(question["question"], question["options"], question["answer"])
|
| 66 |
-
|
| 67 |
for image_number, image_id in enumerate(question["image_ids"], start=1):
|
| 68 |
-
|
| 69 |
-
#
|
| 70 |
-
print(image_number, image_id, len(
|
| 71 |
```
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
```python
|
| 76 |
from pathlib import Path
|
| 77 |
from datasets import load_dataset
|
| 78 |
|
| 79 |
root = Path("/path/to/NJU-HARD")
|
| 80 |
-
questions = load_dataset("parquet",
|
| 81 |
-
"unsplit": str(root / "questions" / "*.parquet")
|
| 82 |
-
})
|
| 83 |
-
images = load_dataset("parquet",
|
| 84 |
-
"unsplit": str(root / "images" / "*.parquet")
|
| 85 |
-
})
|
| 86 |
```
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
```python
|
| 91 |
from datasets import Image, load_dataset
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
first_image = next(iter(image_stream))
|
| 98 |
-
print(first_image["image_id"], len(first_image["image"]["bytes"]))
|
| 99 |
```
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
## 标注与预览
|
| 104 |
-
|
| 105 |
-
`questions` 保留 `question_id`、`question`、`options`、`answer`、`answer_text`、`task_type`、`num_images`、`source_image_paths`、`reference_bbox`、`scene`、`sequence` 和 `quality_flags`。`options` 是 A/B/C/D 结构,二选题的 C/D 为 null。`image_ids` 与 `source_image_paths` 一一对应且顺序不变;源路径仅用于追溯,加载图片使用图片 ID。
|
| 106 |
-
|
| 107 |
-
`images` 另含 `source_image_paths`、`sha256`、`width`、`height` 和 `byte_count`,记录来源、校验值、原始尺寸与字节数;`image_id` 等于完整的 `sha256`。
|
| 108 |
-
|
| 109 |
-
```python
|
| 110 |
-
from datasets import load_dataset
|
| 111 |
-
|
| 112 |
-
preview = load_dataset(
|
| 113 |
-
"RL-MIND/NJU-HARD", "preview", split="sample"
|
| 114 |
-
)
|
| 115 |
-
```
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
-
|
|
|
|
| 35 |
> **Upload in progress:** this release is incomplete until all 180 original-resolution image shards listed in `provenance/image_shards.sha256.jsonl` are present and verified. Each source image is stored once. The `preview` configuration contains browsing thumbnails only.
|
| 36 |
|
| 37 |
|
| 38 |
+
<p align="center">
|
| 39 |
+
<img src="./assets/rl-mind-logo.png" alt="RL-MIND research group" height="160" width="160" />
|
| 40 |
+
|
| 41 |
+
<img src="./assets/dataset-logo.png" alt="NJU-HARD dataset logo" height="160" width="160" />
|
| 42 |
+
</p>
|
| 43 |
+
|
| 44 |
+
<p align="center">
|
| 45 |
+
<a href="https://huggingface.co/datasets/RL-MIND/NJU-HARD">🤗 Hugging Face</a> ·
|
| 46 |
+
<a href="https://www.modelscope.cn/datasets/KAIWANG/NJU-HARD">🟣 ModelScope</a> ·
|
| 47 |
+
<a href="./statistics.json">📊 Statistics</a>
|
| 48 |
+
</p>
|
| 49 |
+
|
| 50 |
+
<p align="center"><b>English</b> | <a href="./README_ZH.md">中文</a></p>
|
| 51 |
+
|
| 52 |
+
## 📚 Introduction
|
| 53 |
+
|
| 54 |
+
**NJU-HARD** is the deduplicated, full-resolution release of the HARD visual question answering data. It contains **1,563 valid VQA records** across **8 task types**, using **854 original aerial images**. Only images referenced by these valid questions are included.
|
| 55 |
+
|
| 56 |
+
Every original JPEG is embedded **once** in a native Hugging Face Parquet image table. Questions refer to images by their full SHA-256 IDs, in the original Image 1 / Image 2 / Image 3 order. The release supports single-image and multi-image VQA without storing the same original repeatedly for different questions.
|
| 57 |
+
|
| 58 |
+
This release packages the question table and original-image table together for distribution on Hugging Face and ModelScope. It is separate from the per-question embedded-image `HARD-VQA` version.
|
| 59 |
+
|
| 60 |
+
## 📊 Dataset at a Glance
|
| 61 |
+
|
| 62 |
+
| Item | Value |
|
| 63 |
+
|:---|:---|
|
| 64 |
+
| Valid questions | 1,563 |
|
| 65 |
+
| Unique original images | 854 distinct paths and SHA-256 hashes |
|
| 66 |
+
| Ordered image references | 2,571 |
|
| 67 |
+
| Images per question | 1, 2, or 3 |
|
| 68 |
+
| Original resolution | 12,768 × 9,564 pixels |
|
| 69 |
+
| Original JPEG bytes | 87,637,348,481 bytes, approximately 87.64 GB |
|
| 70 |
+
| Original-image Parquet shards | 180 |
|
| 71 |
+
| All Parquet files | 87,639,068,405 bytes, including questions and thumbnail preview |
|
| 72 |
+
| Split | `unsplit`; no new train/validation/test split is introduced |
|
| 73 |
+
| Preview | 8 examples, one per task, with derived thumbnails |
|
| 74 |
+
|
| 75 |
+
Original images are **not resized, cropped, or re-encoded**. Thumbnail images are separate browsing aids and are not additional original training or evaluation images.
|
| 76 |
+
|
| 77 |
+
| Source task label | Questions |
|
| 78 |
+
|:---|---:|
|
| 79 |
+
| `classification` | 250 |
|
| 80 |
+
| `counting` | 200 |
|
| 81 |
+
| `property` | 154 |
|
| 82 |
+
| `spatial_relation` | 100 |
|
| 83 |
+
| `task1_specialdetect` | 66 |
|
| 84 |
+
| `task3_region_single` | 151 |
|
| 85 |
+
| `task4_findit_nearbox` | 342 |
|
| 86 |
+
| `task_2_relocate` | 300 |
|
| 87 |
+
| **Total** | **1,563** |
|
| 88 |
+
|
| 89 |
+
## 📦 Data Organization
|
| 90 |
+
|
| 91 |
+
| Configuration | Split | Contents |
|
| 92 |
+
|:---|:---|:---|
|
| 93 |
+
| `questions` **(default)** | `unsplit` | Question text, options, answers, ordered `image_ids`, and source annotations |
|
| 94 |
+
| `images` | `unsplit` | One original image per row, keyed by `image_id`; JPEG bytes embedded as `Image()` |
|
| 95 |
+
| `preview` | `sample` | Eight VQA examples with thumbnails for browsing |
|
| 96 |
+
|
| 97 |
+
```text
|
| 98 |
+
questions/ # 1,563 question records
|
| 99 |
+
images/ # 854 originals in 180 Parquet shards
|
| 100 |
+
preview/ # 8 thumbnail examples
|
| 101 |
+
provenance/ # source/checksum manifests, image index, and validation reports
|
| 102 |
+
statistics.json
|
| 103 |
+
```
|
| 104 |
|
| 105 |
+
The question table preserves `question_id`, `question`, `options`, `answer`, `answer_text`, `task_type`, `num_images`, `source_image_paths`, `reference_bbox`, `scene`, `sequence`, and `quality_flags`. The `options` struct has A/B/C/D fields; C/D are null for binary-choice questions. Ordered `image_ids` correspond one-to-one with `source_image_paths`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
+
The image table contains `image_id`, `image`, `source_image_paths`, `sha256`, `width`, `height`, and `byte_count`. `image_id` equals the SHA-256 of the complete original JPEG. Source paths are provenance only: loading does not require the source server or an external image directory.
|
| 108 |
|
| 109 |
+
## 🚀 Quick Start
|
| 110 |
|
| 111 |
+
Load the small question table first, or inspect the thumbnail preview:
|
| 112 |
|
| 113 |
```python
|
| 114 |
+
from datasets import load_dataset
|
| 115 |
|
| 116 |
REPO = "RL-MIND/NJU-HARD"
|
| 117 |
questions = load_dataset(REPO, "questions", split="unsplit")
|
| 118 |
+
preview = load_dataset(REPO, "preview", split="sample")
|
| 119 |
+
print(questions[0]["question"], questions[0]["image_ids"])
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
To reconstruct a VQA example with original images:
|
| 123 |
+
|
| 124 |
+
```python
|
| 125 |
+
from datasets import Image, load_dataset
|
| 126 |
+
|
| 127 |
images = load_dataset(REPO, "images", split="unsplit")
|
| 128 |
images = images.cast_column("image", Image(decode=False))
|
| 129 |
|
| 130 |
+
# Store only IDs and row numbers in the lookup, not all image bytes.
|
| 131 |
id_to_row = {image_id: i for i, image_id in enumerate(images["image_id"])}
|
| 132 |
question = questions[0]
|
|
|
|
|
|
|
| 133 |
for image_number, image_id in enumerate(question["image_ids"], start=1):
|
| 134 |
+
jpeg_bytes = images[id_to_row[image_id]]["image"]["bytes"]
|
| 135 |
+
# Process this original; iteration preserves the question's image order.
|
| 136 |
+
print(image_number, image_id, len(jpeg_bytes))
|
| 137 |
```
|
| 138 |
|
| 139 |
+
Loading `questions` alone does not download the originals. A full `images` load downloads approximately 87 GB and builds a local cache; allow additional cache space. Datasets **3.6.0 and 5.0.0** have been checked with this format.
|
| 140 |
+
|
| 141 |
+
After downloading a complete repository snapshot from **either platform**, local Parquet loading is also supported:
|
| 142 |
|
| 143 |
```python
|
| 144 |
from pathlib import Path
|
| 145 |
from datasets import load_dataset
|
| 146 |
|
| 147 |
root = Path("/path/to/NJU-HARD")
|
| 148 |
+
questions = load_dataset("parquet", data_files={
|
| 149 |
+
"unsplit": str(root / "questions" / "*.parquet")
|
| 150 |
+
}, split="unsplit")
|
| 151 |
+
images = load_dataset("parquet", data_files={
|
| 152 |
+
"unsplit": str(root / "images" / "*.parquet")
|
| 153 |
+
}, split="unsplit")
|
| 154 |
```
|
| 155 |
|
| 156 |
+
Sequential streaming avoids downloading the entire image table up front:
|
| 157 |
|
| 158 |
```python
|
| 159 |
from datasets import Image, load_dataset
|
| 160 |
|
| 161 |
+
stream = load_dataset(REPO, "images", split="unsplit", streaming=True)
|
| 162 |
+
stream = stream.cast_column("image", Image(decode=False))
|
| 163 |
+
first = next(iter(stream))
|
| 164 |
+
print(first["image_id"], len(first["image"]["bytes"]))
|
|
|
|
|
|
|
| 165 |
```
|
| 166 |
|
| 167 |
+
Streaming is sequential and does not provide random lookup by image ID. For repeated question-to-image joins, use the cached dataset and row-number index above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
+
## 🔍 Validation and Annotation Notes
|
| 170 |
|
| 171 |
+
- The source has 1,565 records. IDs **476 and 496** have null questions, options, and answers and are excluded. Images used only by excluded records are not included.
|
| 172 |
+
- ID **597** is preserved with the flag `duplicate_option_text`: A and B both contain `white`, while the source answer is B.
|
| 173 |
+
- Question text, options, answers, ordered image references, and bounding boxes preserve source values. Structural validation does not establish that every answer is semantically correct.
|
| 174 |
+
- Every original JPEG is checked by SHA-256 before embedding and after Parquet readback. Independent validation checks all question fields, image metadata, reference closure, and image-index rows, plus sampled original bytes through both Datasets versions. Reports are in `provenance/`.
|
| 175 |
+
- Preview images have a 1,024-pixel longest edge and `preview_only=true`. The ordered `images` list and `image_1`/`image_2`/`image_3` columns support browsing; missing slots are null. Preview questions and boxes still use original-image coordinates. Use the originals for evaluation.
|
| 176 |
+
- The source provides no train/validation/test assignment, so all records remain `unsplit`. If you create a split, account for shared images and adjacent frames across partitions.
|
| 177 |
|
| 178 |
+
## 📜 License and Provenance
|
| 179 |
|
| 180 |
+
The source data does not include an explicit license. The dataset card therefore retains **`license: unknown`**. Packaging the data does not grant a new data-use license; consult the data owner for applicable terms.
|
| 181 |
|
| 182 |
+
Source-image checksums, excluded records, the image-to-shard index, and validation evidence are provided in `provenance/`. The paired header uses the supplied RL-MIND group mark and a newly generated NJU-HARD dataset logo.
|
README_ZH.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NJU-HARD
|
| 2 |
+
|
| 3 |
+
<!-- HARD-VQA-DEDUPLICATED-UPLOAD-IN-PROGRESS -->
|
| 4 |
+
> **上传进行中:** 本仓库尚未完整上传;只有 `provenance/image_shards.sha256.jsonl` 中列出的全部 180 个原始分辨率图片分片均已上传并通过校验后,才算完成。每张原图仅存储一次,`preview` 配置仅包含用于浏览的缩略图。
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
<p align="center">
|
| 8 |
+
<img src="./assets/rl-mind-logo.png" alt="RL-MIND research group" height="160" width="160" />
|
| 9 |
+
|
| 10 |
+
<img src="./assets/dataset-logo.png" alt="NJU-HARD dataset logo" height="160" width="160" />
|
| 11 |
+
</p>
|
| 12 |
+
|
| 13 |
+
<p align="center">
|
| 14 |
+
<a href="https://huggingface.co/datasets/RL-MIND/NJU-HARD">🤗 Hugging Face</a> ·
|
| 15 |
+
<a href="https://www.modelscope.cn/datasets/KAIWANG/NJU-HARD">🟣 ModelScope</a> ·
|
| 16 |
+
<a href="./statistics.json">📊 Statistics</a>
|
| 17 |
+
</p>
|
| 18 |
+
|
| 19 |
+
<p align="center"><a href="./README.md">English</a> | <b>中文</b></p>
|
| 20 |
+
|
| 21 |
+
## 📚 数据集介绍
|
| 22 |
+
|
| 23 |
+
**NJU-HARD** 是 HARD 视觉问答数据的完整原图去重版,包含 **1,563 条有效 VQA 记录**,覆盖 **8 类任务**,使用 **854 张原始航拍图像**。只收录这些有效问答实际引用的图片。
|
| 24 |
+
|
| 25 |
+
每张原始 JPEG 仅在 Hugging Face 原生 Parquet 图片表中内嵌 **一次**。问答通过完整 SHA-256 图片 ID 关联原图,保留题目中 Image 1 / Image 2 / Image 3 的顺序。单图和多图问答均可使用,跨问答复用图片不会重复存储原图。
|
| 26 |
+
|
| 27 |
+
本版本把问答表与原图表打包在同一仓库中,分别发布到 Hugging Face 和 ModelScope。它独立于按题目重复内嵌图片的 `HARD-VQA` 版本。
|
| 28 |
+
|
| 29 |
+
## 📊 数据概览
|
| 30 |
+
|
| 31 |
+
| 项目 | 数值 |
|
| 32 |
+
|:---|:---|
|
| 33 |
+
| 有效问答 | 1,563 条 |
|
| 34 |
+
| 唯一原图 | 854 个不同路径、854 个不同 SHA-256 |
|
| 35 |
+
| 有序图片引用 | 2,571 次 |
|
| 36 |
+
| 每题图片数 | 1、2 或 3 张 |
|
| 37 |
+
| 原始分辨率 | 12,768 × 9,564 像素 |
|
| 38 |
+
| 原始 JPEG 总量 | 87,637,348,481 字节,约 87.64 GB |
|
| 39 |
+
| 原图 Parquet 分片 | 180 个 |
|
| 40 |
+
| 全部 Parquet | 87,639,068,405 字节,包含问答和缩略图预览 |
|
| 41 |
+
| 数据划分 | `unsplit`,不新增训练、验证或测试划分 |
|
| 42 |
+
| 预览 | 8 条,每类任务一条,使用派生缩略图 |
|
| 43 |
+
|
| 44 |
+
原图**不缩放、不裁剪、不重新编码**。缩略图仅用于浏览,不是额外的原始训练或评测图片。
|
| 45 |
+
|
| 46 |
+
| 源任务标签 | 问答数量 |
|
| 47 |
+
|:---|---:|
|
| 48 |
+
| `classification` | 250 |
|
| 49 |
+
| `counting` | 200 |
|
| 50 |
+
| `property` | 154 |
|
| 51 |
+
| `spatial_relation` | 100 |
|
| 52 |
+
| `task1_specialdetect` | 66 |
|
| 53 |
+
| `task3_region_single` | 151 |
|
| 54 |
+
| `task4_findit_nearbox` | 342 |
|
| 55 |
+
| `task_2_relocate` | 300 |
|
| 56 |
+
| **合计** | **1,563** |
|
| 57 |
+
|
| 58 |
+
## 📦 数据组织
|
| 59 |
+
|
| 60 |
+
| 配置 | 分区 | 内容 |
|
| 61 |
+
|:---|:---|:---|
|
| 62 |
+
| `questions` **(默认)** | `unsplit` | 问题、选项、答案、有序 `image_ids` 与源标注 |
|
| 63 |
+
| `images` | `unsplit` | 每行一张原图,主键为 `image_id`,JPEG 字节以 `Image()` 内嵌 |
|
| 64 |
+
| `preview` | `sample` | 8 条带缩略图的 VQA 浏览样例 |
|
| 65 |
+
|
| 66 |
+
```text
|
| 67 |
+
questions/ # 1,563 条问答
|
| 68 |
+
images/ # 854 张原图,180 个 Parquet 分片
|
| 69 |
+
preview/ # 8 条缩略图样例
|
| 70 |
+
provenance/ # 来源与校验清单、图片索引、验收报告
|
| 71 |
+
statistics.json
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
问答表保留 `question_id`、`question`、`options`、`answer`、`answer_text`、`task_type`、`num_images`、`source_image_paths`、`reference_bbox`、`scene`、`sequence` 和 `quality_flags`。`options` 包含 A/B/C/D 字段,二选题的 C/D 为 null。`image_ids` 与 `source_image_paths` 一一对应、顺序不变。
|
| 75 |
+
|
| 76 |
+
图片表包含 `image_id`、`image`、`source_image_paths`、`sha256`、`width`、`height` 和 `byte_count`。`image_id` 等于完整原始 JPEG 的 SHA-256。源路径仅供追溯,读取数据不需要原服务器或外部图片目录。
|
| 77 |
+
|
| 78 |
+
## 🚀 快速开始
|
| 79 |
+
|
| 80 |
+
先加载较小的问答表,或查看缩略图预览:
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from datasets import load_dataset
|
| 84 |
+
|
| 85 |
+
REPO = "RL-MIND/NJU-HARD"
|
| 86 |
+
questions = load_dataset(REPO, "questions", split="unsplit")
|
| 87 |
+
preview = load_dataset(REPO, "preview", split="sample")
|
| 88 |
+
print(questions[0]["question"], questions[0]["image_ids"])
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
使用原图还原一条视觉问答:
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
from datasets import Image, load_dataset
|
| 95 |
+
|
| 96 |
+
images = load_dataset(REPO, "images", split="unsplit")
|
| 97 |
+
images = images.cast_column("image", Image(decode=False))
|
| 98 |
+
|
| 99 |
+
# 字典只保存 ID 和行号,不收集所有原图字节。
|
| 100 |
+
id_to_row = {image_id: i for i, image_id in enumerate(images["image_id"])}
|
| 101 |
+
question = questions[0]
|
| 102 |
+
for image_number, image_id in enumerate(question["image_ids"], start=1):
|
| 103 |
+
jpeg_bytes = images[id_to_row[image_id]]["image"]["bytes"]
|
| 104 |
+
# 在此处理当前原图;循环顺序与题目中的图片顺序一致。
|
| 105 |
+
print(image_number, image_id, len(jpeg_bytes))
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
仅加载 `questions` 不会下载原图。完整加载 `images` 会下载约 87 GB 数据并建立本地缓存,请预留额外缓存空间。该格式已用 Datasets **3.6.0 和 5.0.0** 验证。
|
| 109 |
+
|
| 110 |
+
从**任一平台**下载完整仓库快照后,也可直接加载本地 Parquet:
|
| 111 |
+
|
| 112 |
+
```python
|
| 113 |
+
from pathlib import Path
|
| 114 |
+
from datasets import load_dataset
|
| 115 |
+
|
| 116 |
+
root = Path("/path/to/NJU-HARD")
|
| 117 |
+
questions = load_dataset("parquet", data_files={
|
| 118 |
+
"unsplit": str(root / "questions" / "*.parquet")
|
| 119 |
+
}, split="unsplit")
|
| 120 |
+
images = load_dataset("parquet", data_files={
|
| 121 |
+
"unsplit": str(root / "images" / "*.parquet")
|
| 122 |
+
}, split="unsplit")
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
也可顺序流式读取,无需先下载全部原图:
|
| 126 |
+
|
| 127 |
+
```python
|
| 128 |
+
from datasets import Image, load_dataset
|
| 129 |
+
|
| 130 |
+
stream = load_dataset(REPO, "images", split="unsplit", streaming=True)
|
| 131 |
+
stream = stream.cast_column("image", Image(decode=False))
|
| 132 |
+
first = next(iter(stream))
|
| 133 |
+
print(first["image_id"], len(first["image"]["bytes"]))
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
流式读取按顺序消费数据,不提供按图片 ID 随机查找。若需频繁按题取图,使用完整缓存和上述行号索引。
|
| 137 |
+
|
| 138 |
+
## 🔍 校验与标注说明
|
| 139 |
+
|
| 140 |
+
- 源数据共 1,565 条记录。ID **476、496** 的问题、选项、答案为空,已排除;只被这些无效记录引用的图片不收录。
|
| 141 |
+
- ID **597** 原样保留并标记 `duplicate_option_text`:A、B 均为 `white`,源答案为 B。
|
| 142 |
+
- 题文、选项、答案、图片顺序和边界框均保留源值。结构校验不代表逐题验证了答案的语义正确性。
|
| 143 |
+
- 每张原始 JPEG 均在写入前和 Parquet 读回后核对 SHA-256。独立验收覆盖全部问答字段、图片元数据、引用闭合与索引,并通过两个 Datasets 版本抽样核对原图字节。报告位于 `provenance/`。
|
| 144 |
+
- 预览缩略图长边为 1,024 像素,标记 `preview_only=true`。有序 `images` 列和 `image_1`、`image_2`、`image_3` 列用于浏览,缺失图片为 null。预览题目和边界框仍使用原图坐标,正式评测请读取原图。
|
| 145 |
+
- 源数据未提供训练、验证、测试划分,统一保留为 `unsplit`。后续自行划分时,应考虑共享图片和相邻帧跨分区的问题。
|
| 146 |
+
|
| 147 |
+
## 📜 许可与来源
|
| 148 |
+
|
| 149 |
+
源数据未附明确许可证,因此数据卡保留 **`license: unknown`**。本次整理不授予新的数据使用许可,具体条款请向数据所有者确认。
|
| 150 |
+
|
| 151 |
+
`provenance/` 提供原图校验清单、排除记录、图片与分片索引以及验收证据。页首并列展示用户提供的 RL-MIND 团队标志和新生成的 NJU-HARD 数据集图标。
|
assets/dataset-logo.png
ADDED
|
Git LFS Details
|
assets/rl-mind-logo.png
ADDED
|