huuthientran commited on
Commit
95a906d
·
verified ·
1 Parent(s): 6a98c47

Add HumanRef raw TSV training bundle and standalone loader

Browse files
.gitattributes CHANGED
@@ -58,3 +58,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ humanref/train.annotations.tsv filter=lfs diff=lfs merge=lfs -text
62
+ humanref/train.images.tsv filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ task_categories:
5
+ - image-text-to-text
6
+ license: other
7
+ license_name: idea-license-1.0
8
+ license_link: https://huggingface.co/datasets/IDEA-Research/HumanRef-CoT-45k/blob/9e1afd27358d774f626a78992c7b716fa403da54/LICENSE
9
+ size_categories:
10
+ - 10K<n<100K
11
+ tags:
12
+ - visual-grounding
13
+ - referring-expression-comprehension
14
+ - bounding-boxes
15
+ - tsv
16
+ ---
17
+
18
+ # Grounding training data — raw TSV bundle
19
+
20
+ This repository currently contains **HumanRef training data only**, repackaged
21
+ into the indexed TSV storage layout used by
22
+ [Rex-Omni-Finetune-ToyData](https://huggingface.co/datasets/Mountchicken/Rex-Omni-Finetune-ToyData).
23
+ It is a derived storage export, not an official HumanRef release.
24
+
25
+ | Dataset | Split | Query rows | Positive | Rejection |
26
+ | --- | --- | ---: | ---: | ---: |
27
+ | HumanRef | train | 45,408 | 37,057 | 8,351 |
28
+
29
+ There are 86,937 selected target boxes. Images are stored as 45,408 source records;
30
+ repeated images are retained. A prior decoded-image audit found 14,723 unique
31
+ RGB images. This release contains no validation or test split.
32
+
33
+ ## Download and load
34
+
35
+ Download repository files with `huggingface_hub.snapshot_download` or the Hub CLI,
36
+ then use the included plain Python reader. This is an indexed TSV bundle, not a
37
+ Parquet dataset or a Hugging Face `datasets.load_dataset` loading script.
38
+
39
+ ```bash
40
+ pip install huggingface_hub 'Pillow>=10,<13'
41
+ ```
42
+
43
+ ```python
44
+ import sys
45
+ from huggingface_hub import snapshot_download
46
+
47
+ root = snapshot_download(
48
+ repo_id="huuthientran/HumanRef",
49
+ repo_type="dataset",
50
+ allow_patterns=["humanref/*", "loader.py", "requirements.txt", "benchmarks.json"],
51
+ )
52
+ sys.path.insert(0, root)
53
+ from loader import RawTSVDataset
54
+
55
+ data = RawTSVDataset(f"{root}/humanref")
56
+ raw = data[0] # original image_bytes + annotation dictionary
57
+ sample = data.decode(raw) # RGB image; no EXIF auto-rotation
58
+ boxes = sample["annotation"]["boxes"]
59
+ positive = RawTSVDataset(f"{root}/humanref", positive_only=True)
60
+ ```
61
+
62
+ The loader requires only Pillow. Pin `revision` in `snapshot_download` to a
63
+ repository commit for reproducible experiments. Data files total about 11 GiB.
64
+
65
+ ## Files and format
66
+
67
+ ```text
68
+ README.md
69
+ loader.py
70
+ requirements.txt
71
+ benchmarks.json
72
+ humanref/
73
+ train.images.tsv
74
+ train.images.tsv.lineidx
75
+ train.annotations.tsv
76
+ train.annotations.tsv.lineidx
77
+ train.positive.annotations.tsv.lineidx
78
+ images.jsonl
79
+ manifest.json
80
+ validation.json
81
+ SOURCE_LICENSE
82
+ ```
83
+
84
+ Image rows are `image_byte_offset<TAB>base64_original_image_bytes`.
85
+ Annotation rows are `image_byte_offset<TAB>annotation_JSON`.
86
+ Each `.lineidx` stores byte offsets, not row numbers. The positive index selects
87
+ positive annotation rows without rewriting the base data. `images.jsonl` records
88
+ image checksums and dimensions; `manifest.json` records file checksums and source
89
+ provenance. `validation.json` reports validation performed before publication.
90
+
91
+ For positive queries, `boxes` contains selected targets:
92
+
93
+ ```json
94
+ {"bbox": [10, 20, 100, 200], "phrase": "the person on the left"}
95
+ ```
96
+
97
+ For rejection queries, it contains a null box:
98
+
99
+ ```json
100
+ {"bbox": null, "phrase": "an unmatched description"}
101
+ ```
102
+
103
+ Boxes are **absolute pixel xyxy**. Source `region_map` indices select candidates
104
+ from original pixel-xywh `gt_boxes`; only selected candidates become targets.
105
+ Every query retains the complete original `source_annotation`, including candidate
106
+ boxes, region mapping, and source reasoning text, together with source subset and
107
+ offset provenance. Source reasoning is provenance, not an inference prompt or a
108
+ direct-box answer. Separate copies of the original annotation TSVs are omitted
109
+ because their annotations are already embedded in every exported query.
110
+
111
+ Image bytes and original annotations are preserved. No resizing, re-encoding,
112
+ EXIF transpose, clipping, normalization, quantization, filtering, or deduplication
113
+ is applied. Qwen pixel/normalized formatting and Rex coordinate-token formatting
114
+ belong in the experiment's runtime adapter. For a compatible grounding reader,
115
+ configure the box format as `xyxy`.
116
+
117
+ ## Scope and quality
118
+
119
+ All image-byte checksums, file checksums, byte offsets, selected-target mappings,
120
+ and positive/rejection counts passed validation. Loader samples were decoded;
121
+ full exports were checked by image checksums and headers, not a second exhaustive
122
+ raster decode.
123
+
124
+ This is raw training storage. Known duplicate queries, conflicting targets, and
125
+ boxes extending beyond image boundaries remain unchanged. Select a training
126
+ policy explicitly; do not silently clip or treat candidate boxes as targets.
127
+ The manifest's `ready_for_training: false` indicates that experiment-specific
128
+ selection and model formatting are still required, not a failed storage check.
129
+
130
+ ## Extending the bundle
131
+
132
+ Each benchmark has its own top-level directory and manifest, using the same
133
+ image/annotation TSV envelope. `benchmarks.json` lists only datasets actually
134
+ included in this repository. Future releases can add `refcocog/`, `coco/`
135
+ (COCO-Keypoints), `ap10k/`, `coco_detection/`, or `lvis/` without moving HumanRef
136
+ or changing its loader paths. **None of those benchmarks is included yet.**
137
+
138
+ Task-specific annotation schemas remain distinct: grounding, detection, and pose
139
+ adapters must interpret their respective fields. Shared storage layout does not
140
+ imply identical training targets. Future datasets carry their own provenance,
141
+ validation, and license; HumanRef's license does not automatically cover them.
142
+
143
+ ## Source and license
144
+
145
+ Source: [IDEA-Research/HumanRef-CoT-45k](https://huggingface.co/datasets/IDEA-Research/HumanRef-CoT-45k),
146
+ revision `9e1afd27358d774f626a78992c7b716fa403da54`.
147
+ Both `humanref_cot` and `humanref_cot_rejection` are included in source order.
148
+ The four source TSV checksums matched the audited source revision.
149
+
150
+ The upstream [IDEA License 1.0](humanref/SOURCE_LICENSE) is included unchanged;
151
+ it grants use for non-commercial research and requires a separate license for
152
+ commercial use. Original attribution: "T is licensed under the IDEA License 1.0,
153
+ Copyright (c) IDEA. All Rights Reserved."
benchmarks.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "rex-toy-tsv",
3
+ "format_version": 1,
4
+ "datasets": {
5
+ "humanref": {
6
+ "path": "humanref",
7
+ "split": "train",
8
+ "schema": "rex-tsv-grounding-v1",
9
+ "manifest": "humanref/manifest.json"
10
+ }
11
+ }
12
+ }
humanref/SOURCE_LICENSE ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ IDEA License 1.0
2
+
3
+ This License Agreement (as may be amended in accordance with this License Agreement, “License”), between you, or your employer or other entity (if you are entering into this agreement on behalf of your employer or other entity) (“Licensee” or “you”) and the International Digital Economy Academy (“IDEA” or “we”) applies to your use of any computer program, algorithm, source code, object code, or software that is made available by IDEA under this License (“Software”) and any specifications, manuals, documentation, and other written information provided by IDEA related to the Software (“Documentation”).
4
+
5
+ By downloading the Software or by using the Software, you agree to the terms of this License. If you do not agree to this License, then you do not have any rights to use the Software or Documentation (collectively, the “Software Products”), and you must immediately cease using the Software Products. If you are agreeing to be bound by the terms of this License on behalf of your employer or other entity, you represent and warrant to IDEA that you have full legal authority to bind your employer or such entity to this License. If you do not have the requisite authority, you may not accept the License or access the Software Products on behalf of your employer or other entity.
6
+
7
+ 1. LICENSE GRANT
8
+
9
+ a. You are granted a non-exclusive, worldwide, transferable, sublicensable, irrevocable, royalty free and limited license under IDEA’s copyright interests to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Software solely for your non-commercial research purposes.
10
+
11
+ b. The grant of rights expressly set forth in this Section 1 (License Grant) are the complete grant of rights to you in the Software Products, and no other licenses are granted, whether by waiver, estoppel, implication, equity or otherwise. IDEA and its licensors reserve all rights not expressly granted by this License.
12
+
13
+ c. If you intend to use the Software Products for any commercial purposes, you must request a license from IDEA, which IDEA may grant to you in its sole discretion.
14
+
15
+ 2. REDISTRIBUTION AND USE
16
+
17
+ a. If you distribute or make the Software Products, or any derivative works thereof, available to a third party, you shall provide a copy of this Agreement to such third party.
18
+
19
+ b. You must retain in all copies of the Software Products that you distribute the following attribution notice: "T is licensed under the IDEA License 1.0, Copyright (c) IDEA. All Rights Reserved."
20
+
21
+ d. Your use of the Software Products must comply with applicable laws and regulations (including trade compliance laws and regulations).
22
+
23
+ e. You will not, and will not permit, assist or cause any third party to use, modify, copy, reproduce, create derivative works of, or distribute the Software Products (or any derivative works thereof, works incorporating the Software Products, or any data produced by the Software), in whole or in part, for in any manner that infringes, misappropriates, or otherwise violates any third-party rights.
24
+
25
+ 3. DISCLAIMER OF WARRANTY
26
+
27
+ UNLESS REQUIRED BY APPLICABLE LAW, THE SOFTWARE PRODUCTS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SOFTWARE PRODUCTS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SOFTWARE PRODUCTS AND ANY OUTPUT AND RESULTS.
28
+
29
+ 4. LIMITATION OF LIABILITY
30
+
31
+ IN NO EVENT WILL IDEA OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF IDEA OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
32
+
33
+ 5. INDEMNIFICATION
34
+
35
+ You will indemnify, defend and hold harmless IDEA and our subsidiaries and affiliates, and each of our respective shareholders, directors, officers, employees, agents, successors, and assigns (collectively, the “IDEA Parties”) from and against any losses, liabilities, damages, fines, penalties, and expenses (including reasonable attorneys’ fees) incurred by any IDEA Party in connection with any claim, demand, allegation, lawsuit, proceeding, or investigation (collectively, “Claims”) arising out of or related to: (a) your access to or use of the Software Products (as well as any results or data generated from such access or use); (b) your violation of this License; or (c) your violation, misappropriation or infringement of any rights of another (including intellectual property or other proprietary rights and privacy rights). You will promptly notify the IDEA Parties of any such Claims, and cooperate with IDEA Parties in defending such Claims. You will also grant the IDEA Parties sole control of the defense or settlement, at IDEA’s sole option, of any Claims. This indemnity is in addition to, and not in lieu of, any other indemnities or remedies set forth in a written agreement between you and IDEA or the other IDEA Parties.
36
+
37
+ 6. TERMINATION; SURVIVAL
38
+
39
+ a. This License will automatically terminate upon any breach by you of the terms of this License.
40
+
41
+ b. If you institute litigation or other proceedings against IDEA or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Software Products, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted.
42
+
43
+ c. The following sections survive termination of this License: 2 (Redistribution and use), 3 (Disclaimers of Warranty), 4 (Limitation of Liability), 5 (Indemnification), 6 (Termination; Survival), 7 (Trademarks) and 8 (Applicable Law; Dispute Resolution).
44
+
45
+ 7. TRADEMARKS
46
+
47
+ Licensee has not been granted any trademark license as part of this License and may not use any name or mark associated with IDEA without the prior written permission of IDEA, except to the extent necessary to make the reference required by the attribution notice of this Agreement.
48
+
49
+ 8. APPLICABLE LAW; DISPUTE RESOLUTION
50
+
51
+ This License will be governed and construed under the laws of the People’s Republic of China without regard to conflicts of law provisions. The parties expressly agree that the United Nations Convention on Contracts for the International Sale of Goods will not apply. Any suit or proceeding arising out of or relating to this License will be brought in the courts, as applicable, in Shenzhen, Guangdong, and each party irrevocably submits to the jurisdiction and venue of such courts.
humanref/images.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
humanref/manifest.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "humanref",
3
+ "source": "https://huggingface.co/datasets/IDEA-Research/HumanRef-CoT-45k",
4
+ "subset": false,
5
+ "source_counts": {
6
+ "humanref_cot": {
7
+ "source_annotation_rows": 37057,
8
+ "images": 37057,
9
+ "positive": 37057,
10
+ "negative": 0
11
+ },
12
+ "humanref_cot_rejection": {
13
+ "source_annotation_rows": 8351,
14
+ "images": 8351,
15
+ "positive": 0,
16
+ "negative": 8351
17
+ }
18
+ },
19
+ "source_checksums": {
20
+ "humanref_cot.annotations.tsv": "7e384a8cfa851364bf9d198057d385685aab6a17fa4ef369603e326080400d6a",
21
+ "humanref_cot.images.tsv": "103a372c54ecf907e198bca8c74e3d59de50dca03d8d30e22537be51f2fcf85a",
22
+ "humanref_cot_rejection.annotations.tsv": "a3c8da68b60f2f8f4c70c6256ffec5da780b1aa5d926ef102e1eff5ff593c7df",
23
+ "humanref_cot_rejection.images.tsv": "da5369c6d1d06de0acd5ee1bb004930cc5ce619b5c1f7adf1c7e48b45105e727"
24
+ },
25
+ "image_record_policy": "One stored image per referenced source TSV record; identical contents are not deduplicated.",
26
+ "training_warning": "Raw duplicates, conflicts, and out-of-image boxes are preserved. Source think text is provenance, not a direct-box target.",
27
+ "format": "rex-toy-tsv",
28
+ "format_version": 1,
29
+ "toy_source": "Mountchicken/Rex-Omni-Finetune-ToyData@a8ce2750cb60921cd1b734227bb5e1e2d5ad55ef",
30
+ "split": "train",
31
+ "coordinate_format": "absolute pixel xyxy; original pixel xywh preserved in source_annotation",
32
+ "image_encoding": "base64 of original bytes; no resize, EXIF transpose, or re-encoding",
33
+ "annotations": 45408,
34
+ "images": 45408,
35
+ "positive_rows": 37057,
36
+ "files": {
37
+ "train.images.tsv": {
38
+ "sha256": "78bcb4d6ce3018a43e59f3c98016cfc50225d7cf23a202f3fb48e52689564822",
39
+ "bytes": 11623877640
40
+ },
41
+ "train.annotations.tsv": {
42
+ "sha256": "aa5d37c81d9802b4953d780c344580e95381449c0f297a9148334990ca1dc8a6",
43
+ "bytes": 133314604
44
+ },
45
+ "train.annotations.tsv.lineidx": {
46
+ "sha256": "38a17bfd8c37bdae60c806c7577572ce151ba81d9d19daf399e142aaa0b04de0",
47
+ "bytes": 416353
48
+ },
49
+ "train.images.tsv.lineidx": {
50
+ "sha256": "bd8b543dd2f556e3a4d47268b8da188ae77394e745eb36acad4aaa2a1fc871f9",
51
+ "bytes": 501624
52
+ },
53
+ "train.positive.annotations.tsv.lineidx": {
54
+ "sha256": "7e2fd10d64f8ca98b3d8cf53c28318bbbc0a42c505253d9a330efd1a10860819",
55
+ "bytes": 332843
56
+ },
57
+ "images.jsonl": {
58
+ "sha256": "aaa30a5a437a788c542bb843d8d21a57816733a5eb5bce0b947af9c4d2387763",
59
+ "bytes": 7882352
60
+ }
61
+ },
62
+ "selection": "all source train records, original order; no deduplication or leakage filtering",
63
+ "ready_for_training": false,
64
+ "source_revision": "9e1afd27358d774f626a78992c7b716fa403da54",
65
+ "source_checksums_match_prior_audit": true
66
+ }
humanref/train.annotations.tsv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa5d37c81d9802b4953d780c344580e95381449c0f297a9148334990ca1dc8a6
3
+ size 133314604
humanref/train.annotations.tsv.lineidx ADDED
The diff for this file is too large to render. See raw diff
 
humanref/train.images.tsv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78bcb4d6ce3018a43e59f3c98016cfc50225d7cf23a202f3fb48e52689564822
3
+ size 11623877640
humanref/train.images.tsv.lineidx ADDED
The diff for this file is too large to render. See raw diff
 
humanref/train.positive.annotations.tsv.lineidx ADDED
The diff for this file is too large to render. See raw diff
 
humanref/validation.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "passed",
3
+ "dataset": "humanref",
4
+ "images": 45408,
5
+ "annotations": 45408,
6
+ "positive_rows": 37057,
7
+ "negative_rows": 8351,
8
+ "target_boxes": 86937,
9
+ "full_pixel_decode": false,
10
+ "original_image_bytes_verified": true,
11
+ "all_byte_offsets_verified": true,
12
+ "raw_annotations_verified": true,
13
+ "subset": false
14
+ }
loader.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Read raw pixel annotations; no coordinate quantization or target formatting."""
2
+ import base64
3
+ import io
4
+ import json
5
+ from pathlib import Path
6
+ from PIL import Image
7
+
8
+
9
+ class RawTSVDataset:
10
+ def __init__(self, root, positive_only=False):
11
+ self.root = Path(root)
12
+ self.manifest = json.loads((self.root/'manifest.json').read_text())
13
+ name = 'train.positive.annotations.tsv.lineidx' if positive_only else 'train.annotations.tsv.lineidx'
14
+ self.offsets = [int(x) for x in (self.root/name).read_text().splitlines()]
15
+
16
+ def __len__(self):
17
+ return len(self.offsets)
18
+
19
+ def __getitem__(self, index):
20
+ # Open per request: safe under fork/spawn and concurrent readers.
21
+ with (self.root/'train.annotations.tsv').open('rb') as f:
22
+ f.seek(self.offsets[index])
23
+ offset, payload = f.readline().split(b'\t', 1)
24
+ annotation = json.loads(payload)
25
+ with (self.root/'train.images.tsv').open('rb') as f:
26
+ f.seek(int(offset))
27
+ key, encoded = f.readline().rstrip(b'\n').split(b'\t', 1)
28
+ if int(key) != int(offset):
29
+ raise ValueError('Image offset mismatch')
30
+ data = base64.b64decode(encoded, validate=True)
31
+ return {'image_bytes': data, 'annotation': annotation}
32
+
33
+ @staticmethod
34
+ def decode(sample):
35
+ # Do not EXIF-transpose: all coordinates describe the stored raster.
36
+ with Image.open(io.BytesIO(sample['image_bytes'])) as source:
37
+ image = source.convert('RGB')
38
+ image.info.pop('exif', None)
39
+ ann = sample['annotation']
40
+ if image.size != (ann['width'], ann['height']):
41
+ raise ValueError('Image size mismatch')
42
+ return {'image': image, 'annotation': ann}
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Pillow>=10,<13