exiawsh commited on
Commit
1b621ac
·
verified ·
1 Parent(s): caae563

Rewrite dataset card around data domains and usage

Browse files
Files changed (3) hide show
  1. README.md +231 -251
  2. README_CN.md +216 -231
  3. manifests/files.jsonl +0 -0
README.md CHANGED
@@ -5,229 +5,270 @@ task_categories:
5
  tags:
6
  - visual-grounding
7
  - pointing
 
 
8
  - megatron-energon
9
  - webdataset
10
  - multimodal
11
- size_categories:
12
- - 10M<n<100M
13
  ---
14
 
15
  # LocateAnything-Data
16
 
17
- [中文说明](README_CN.md) | [Hugging Face repository](https://huggingface.co/datasets/NVEagle/LocateAnything-Data)
18
-
19
- > Official release repository:
20
- > [`NVEagle/LocateAnything-Data`](https://huggingface.co/datasets/NVEagle/LocateAnything-Data).
21
- > This collection does not declare a single umbrella license. Before using any
22
- > component, consult and comply with the license and terms of its original
23
- > upstream dataset.
24
-
25
- LocateAnything-Data is a spatial vision-language training collection packaged
26
- for indexed JSONL access and Megatron-Energon. It contains object detection,
27
- visual grounding, and pointing records. It deliberately excludes VQA,
28
- benchmark, test, validation, chat, and internal build-provenance data.
29
-
30
- Dataset inventory:
31
-
32
- | Item | Count |
33
- |---|---:|
34
- | Dataset folders | 42 |
35
- | Annotation views | 47 |
36
- | Training records | 10,136,648 |
37
- | Canonical media pools | 41 |
38
- | Referenced physical images | 9,801,026 total; 7,402,667 hosted |
39
- | Canonical TAR shards | 926 in the source inventory; 583 hosted |
40
-
41
- OS-Atlas is part of this unified 42-dataset release. It is not published as a
42
- second copy or a separate media repository.
43
-
44
- ## Media redistribution boundary
45
-
46
- All 47 annotation views and the sanitized record-to-source-image mappings are
47
- in release scope. Images from the following seven upstream sources are not
48
- redistributed. Users must obtain those images from the official source and
49
- hydrate them locally.
50
-
51
- | Upstream source | LocateAnything dataset ID | Canonical pool ID | Records | Official access | Expected source-relative path |
52
- |---|---|---|---:|---|---|
53
- | CrowdHuman | `crowdhuman` | `locany--crowdhuman--train--source_image--v000001` | 15,000 | [download](https://www.crowdhuman.org/download.html) | `train/Images/<name>.jpg` |
54
- | DeepFashion2 | `deepfashion2` | `locany--deepfashion2--train--source_image--v000001` | 191,961 | [instructions](https://github.com/switchablenorms/DeepFashion2), [request form](https://docs.google.com/forms/d/e/1FAIpQLSeIoGaFfCQILrtIZPykkr8q_h9qQ5BoTYbjvf95aXbid0v2Bw/viewform) | `train/image/000001.jpg` |
55
- | Flickr30K | `flickr30k` | `locany--flickr30k--train--source_image--v000001` | 29,781 | [official page](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) | `flickr30k-images/<flickr_id>.jpg` |
56
- | ImageNet | `partimagenet` | `locany--imagenet--train--source_image--v000001` | 100,000 | [download/request access](https://www.image-net.org/download.php) | `train/<wnid>/<wnid>_*.JPEG` |
57
- | Objects365 | `object365` | `locany--object365--train--source_image--v000001` | 1,742,289 | [download and terms](https://www.objects365.org/download.html) | `images/train/patch*/objects365_v1_*.jpg` |
58
- | SKU-110K | `sku110k` | `locany--sku110k--train--source_image--v000001` | 8,219 | [author repository](https://github.com/eg4000/SKU110K_CVPR19) | `images/train_*.jpg` |
59
- | Unsplash | `unsplash` | `locany--unsplash--train--source_image--v000001` | 329,721 | [dataset access](https://unsplash.com/data), [dataset terms](https://github.com/unsplash/datasets/blob/master/TERMS.md) | `raw_unsplash_images/<photo_id>.jpg` |
60
-
61
- ImageNet is a media source, not a LocateAnything dataset folder. Its images are
62
- used by the `partimagenet` annotation view. Objects365 is the official upstream
63
- name; `object365` is the stable LocateAnything dataset ID.
64
-
65
- These seven sources account for 2,416,971 records, 2,398,359 physical images,
66
- and 343 internal TAR shards. None of those TAR payloads are part of the public
67
- repository. The remaining hosted subset contains 35 dataset folders,
68
- 7,719,677 records, 34 media pools, 7,402,667 physical images, and 583 TAR
69
- shards. Every hosted TAR has exactly one repository path.
70
-
71
- This repository is not a mirror of the seven upstream datasets and grants no
72
- rights to their media. Obtain the media independently, accept the terms in
73
- effect at download time, and preserve filenames and directory layout. The
74
- hydration tooling does not bypass registration, request forms, passwords, or
75
- access controls.
76
-
77
- Additional source-specific notes:
78
-
79
- - CrowdHuman requires the training image archives referenced by the mapping.
80
- Its official page states that the images must not be redistributed.
81
- - DeepFashion2 requires a per-user access request and a password for the
82
- archives. The released mapping references `train/image`.
83
- - Flickr30K images remain subject to Flickr's terms. The official project also
84
- offers a publicly distributable links-and-captions version.
85
- - The ImageNet view uses a 100,000-image subset of the ILSVRC-style training
86
- layout. Do not flatten synset directories.
87
- - Objects365 users should preserve the V1/V2 package filenames and use the
88
- official annotation `file_name` values rather than renaming images.
89
- - SKU-110K users should preserve the extracted image and CSV layout.
90
- - The Unsplash Lite release is not necessarily sufficient for this 329,721
91
- image mapping. Obtain the matching authorized release and require SHA-256
92
- verification; do not substitute similarly named images.
93
-
94
- ## Repository layout
95
-
96
- The repository keeps one canonical path for every payload:
97
 
98
  ```text
99
  LocateAnything-Data/
100
- ├── .gitattributes
101
- ├── README.md
102
- ├── README_CN.md
103
- ├── release-policy.json
104
- ├── metadataset.yaml # immediately usable hosted subset
105
- ├── metadataset-full.yaml # all 42 datasets after local hydration
106
- ├── manifests/
107
- │ ├── release.json
108
- │ ├── files.jsonl
109
- │ ├── datasets.jsonl
110
- │ ├── views.jsonl
111
- │ ├── media-pools.jsonl
112
- │ └── restricted-media.json
113
  ├── datasets/
114
  │ └── <dataset_id>/
115
  │ ├── metadataset.yaml
116
- │ └── views/
117
- │ └── <view_id>/
118
- │ ├── metadataset.yaml
119
- │ ├── records.jsonl
120
- │ └── records.jsonl.idx
121
  ├── media/
122
  │ └── <pool_id>/
123
- │ ├── availability.json
124
- │ ├── .nv-meta/ # present only for hosted media
125
- │ └── shards/ # present only for hosted media
126
  │ ├── image-NNNNNNNN.tar
127
  │ └── image-NNNNNNNN.tar.idx
128
  ├── mappings/
129
- │ ├── media/<pool_id>/part-NNNNN.parquet
130
- │ └── views/<dataset_id>/<view_id>/part-NNNNN.parquet
131
- ├── schemas/
132
- │ ├── media-source-map.schema.json
133
- │ └── view-source-map.schema.json
134
  ├── examples/
135
- │ ├── read_indexed_jsonl.py
136
- │ └── read_energon.py
137
  └── tools/
138
- ├── hydrate_restricted_media.py
139
- └── verify_release.py
140
  ```
141
 
142
- There is intentionally no `datasets/<dataset_id>/media/` tree. From
143
- `datasets/<dataset_id>/views/<view_id>/metadataset.yaml`, every auxiliary media
144
- path must be exactly `../../../../media/<pool_id>`. The seven external pools
145
- contain only `availability.json` until a user hydrates them locally.
 
 
146
 
147
- `metadataset.yaml` blends the 35 datasets whose media is hosted on Hugging
148
- Face. `metadataset-full.yaml` blends all 42 datasets and must fail fast until
149
- the seven external pools have been hydrated and validated.
150
 
151
- ## Annotation format
152
-
153
- Annotations remain human-previewable JSON Lines. One line is one independent
154
- training record. The following is an abridged schema example:
155
 
156
  ```json
157
  {
158
  "_source": {
159
- "schema": "eagle-energon.source-record/v1",
160
- "dataset_id": "crowdhuman",
161
- "view_id": "locate_anything_crowdhuman_crowdhuman",
162
- "sample_id": "crowdhuman:locate_anything_crowdhuman_crowdhuman:file:0009:row:000000000000",
163
- "source_annotation": "annotations/CrowdHuman/CrowdHuman.jsonl",
164
- "source_file_index": 9,
165
- "source_row": 0,
166
- "source_record_sha256": "<sha256>"
167
  },
168
  "image": {
169
  "kind": "image",
170
  "source": "media_00",
171
- "path": "m/000000000082.jpg"
172
  },
173
  "query": {
174
- "Person": [[1, 410, 168, 1000]]
175
  },
176
  "task_type": "detection_grounding"
177
  }
178
  ```
179
 
180
- `query` values are numeric points `[x, y]` or boxes
181
- `[x1, y1, x2, y2]`. The reader does not rescale or rewrite them.
182
- `image.source` selects the view's Energon auxiliary pool and `image.path` is
183
- the exact TAR member name. Never infer a source filename from the packed
184
- member name.
185
 
186
- `records.jsonl.idx` is a little-endian uint64 array with `N + 1` byte offsets
187
- for `N` records. Row `i` occupies
188
- `[offset[i], offset[i + 1])`, enabling O(1) indexed record access.
189
 
190
- Preview records:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
 
192
  ```bash
193
  sed -n '1,3p' \
194
- datasets/object365/views/locate_anything_object365_object365/records.jsonl \
195
- | jq -c .
196
  ```
197
 
198
- Read one indexed row without loading the file:
199
 
200
  ```bash
201
  python examples/read_indexed_jsonl.py \
202
- datasets/object365/views/locate_anything_object365_object365/records.jsonl \
203
  100
204
  ```
205
 
206
- ## Public source-image mapping
207
 
208
- The public repository does not contain the internal SQLite mapping databases,
209
- which include absolute paths and filesystem evidence. Instead, it contains two
210
- normalized, Zstandard-compressed Parquet relations:
211
 
212
- 1. `mappings/media/<pool_id>/...` has one row per upstream source-image alias.
213
- It maps the original dataset-relative filename/path and SHA-256 to a
214
- canonical `member_name` and content SHA-256.
215
- 2. `mappings/views/<dataset_id>/<view_id>/...` has one row per record-media
216
- occurrence. It maps the record lineage and JSON pointer to the exact
217
- pool-local `source_id` and canonical member.
218
 
219
- The second relation is required because byte-identical images can have multiple
220
- upstream filenames. Joining only on `member_name` would be ambiguous. The
221
- authoritative join is `(pool_id, source_id)`.
222
- `source_snapshot_id` identifies the conversion/source-manifest snapshot; it
223
- must not be interpreted as an upstream dataset release name.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
- Example: recover the exact original source image for record row 12,911:
226
 
227
- ```sql
228
- INSTALL parquet;
229
- LOAD parquet;
 
 
 
 
 
 
 
 
230
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  SELECT
232
  v.row_id,
233
  v.source_sample_id,
@@ -242,59 +283,26 @@ JOIN read_parquet(
242
  'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
243
  ) AS m
244
  USING (pool_id, source_id)
245
- WHERE v.row_id = 12911;
246
- ```
247
-
248
- Reverse lookup from an upstream path to all LocateAnything records:
249
-
250
- ```sql
251
- SELECT v.dataset_id, v.view_id, v.row_id, v.source_sample_id
252
- FROM read_parquet(
253
- 'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
254
- ) AS m
255
- JOIN read_parquet(
256
- 'mappings/views/crowdhuman/locate_anything_crowdhuman_crowdhuman/*.parquet'
257
- ) AS v
258
- USING (pool_id, source_id)
259
- WHERE m.source_relative_path =
260
- 'train/Images/273271,1017c000ac1360b7.jpg';
261
  ```
262
 
263
- The public mapping preserves original source filenames, not LMDB keys or
264
- packed member names. It never contains `source_absolute_path`, internal
265
- annotation paths, Lustre paths, usernames, inode/device metadata, symlink
266
- targets, access tokens, cookies, or signed URLs. See the schemas under
267
- `schemas/`.
268
-
269
- ## Reading with Megatron-Energon
270
 
271
- The storage contract targets `megatron-energon==7.4.0`. Use:
 
272
 
273
- - `metadataset.yaml` for the immediately readable hosted subset;
274
- - `metadataset-full.yaml` after all seven external pools are hydrated;
275
- - `datasets/<dataset_id>/metadataset.yaml` for one dataset; or
276
- - a view-level `metadataset.yaml` for debugging.
 
 
 
 
 
277
 
278
- The format supports random indexed JSONL rows, indexed uncompressed TAR
279
- samples, multiple workers, rank-aware partitioning, and stream packing. For an
280
- exact without-replacement sample permutation, use one indexed row per
281
- Energon slice (`max_samples_per_sequence=1`), one epoch shuffle multiplier,
282
- and no second shuffle buffer. Packing should happen after sample
283
- randomization.
284
-
285
- The repository provides a small task encoder and runnable loader in
286
- `examples/read_energon.py`:
287
-
288
- ```bash
289
- python examples/read_energon.py metadataset.yaml --workers 8 --samples 3
290
- ```
291
-
292
- A missing external pool is an error: training code must not silently skip
293
- records.
294
-
295
- ## Hydrating the seven external media pools
296
-
297
- The hydrator uses the public mapping as the sole file list:
298
 
299
  ```bash
300
  python tools/hydrate_restricted_media.py \
@@ -303,44 +311,16 @@ python tools/hydrate_restricted_media.py \
303
  --source-root /data/upstream/CrowdHuman
304
  ```
305
 
306
- For every mapped source image it:
307
-
308
- 1. resolve the exact `source_relative_path`, never basename-guess;
309
- 2. verify byte length and SHA-256;
310
- 3. preserve the stable `member_name`;
311
- 4. content-deduplicate within the canonical pool;
312
- 5. write approximately 4 GiB uncompressed TAR shards;
313
- 6. build `.tar.idx` and official Energon `.nv-meta`;
314
- 7. verify every annotation reference; and
315
- 8. write a local receipt.
316
-
317
- Hydrated media remains local and must never be pushed back to the Hugging Face
318
- repository.
319
-
320
- ## Canonical storage and deduplication
321
-
322
- - `NVEagle/LocateAnything-Data` is the collection's single canonical Hugging
323
- Face dataset repository.
324
- - Every canonical TAR has exactly one
325
- `media/<pool_id>/shards/` repository path.
326
- - Dataset-local media projections are not part of the repository.
327
- - OS-Atlas belongs to the unified catalog and has no separate copy.
328
- - `manifests/files.jsonl` lists every release object except itself, with one
329
- row per canonical repository path.
330
-
331
- Hugging Face Xet may deduplicate chunks internally; this does not change the
332
- path-level storage contract above.
333
-
334
- ## Licenses and upstream terms
335
-
336
- LocateAnything-Data combines annotations and references derived from multiple
337
- upstream datasets, so this repository does not select or imply one unified
338
- license for all components. Each upstream dataset remains governed by its own
339
- license, terms of use, access conditions, and attribution requirements. Users
340
- must review the official upstream source linked in this README and comply with
341
- the applicable terms before downloading, hydrating, using, or redistributing
342
- any component. This repository does not grant additional rights to upstream
343
- media.
344
 
345
  ## Citation
346
 
 
5
  tags:
6
  - visual-grounding
7
  - pointing
8
+ - document-layout-analysis
9
+ - gui-grounding
10
  - megatron-energon
11
  - webdataset
12
  - multimodal
 
 
13
  ---
14
 
15
  # LocateAnything-Data
16
 
17
+ [中文](README_CN.md) · [Paper](https://arxiv.org/abs/2605.27365) ·
18
+ [Model](https://huggingface.co/nvidia/LocateAnything-3B) ·
19
+ [Code](https://github.com/NVlabs/Eagle/tree/main/Embodied)
20
+
21
+ ## Overview
22
+
23
+ LocateAnything-Data is the public training-data release for
24
+ **LocateAnything: Fast and High-Quality Vision-Language Grounding with Parallel
25
+ Box Decoding**.
26
+
27
+ LocateAnything formulates detection and visual grounding as a unified
28
+ vision-language task. Given an image and a category, phrase, text string, or
29
+ action-oriented instruction, the model predicts the corresponding bounding
30
+ boxes or points. The data spans natural images, dense scenes, people,
31
+ autonomous driving, embodied interaction, graphical user interfaces, scene
32
+ text, documents, and tables.
33
+
34
+ The paper's Parallel Box Decoding treats a box or point as a structured
35
+ geometric unit instead of generating its coordinates independently.
36
+ LocateAnything-Data provides the diverse spatial supervision used to train
37
+ this unified formulation across visual domains.
38
+
39
+ This repository provides:
40
+
41
+ - detection, grounding, and pointing annotations in previewable JSONL;
42
+ - image media packed as indexed WebDataset TAR shards;
43
+ - Megatron-Energon metadata for distributed training; and
44
+ - public mappings from every training record and packed image back to its
45
+ original dataset-relative media name.
46
+
47
+ ## Data coverage
48
+
49
+ The following grouping describes the main visual domains in this release.
50
+ Several datasets naturally support more than one domain or task.
51
+
52
+ | Domain | Included datasets |
53
+ |---|---|
54
+ | General detection and grounding | COCO, RefCOCO, RefCOCO+, RefCOCOg, G-RefCOCO, Flickr30K, HumanRef-CoT, Objects365, Open Images V6, OWDOD, PACO, PartImageNet, Unsplash, V3Det |
55
+ | Dense object detection | CrowdHuman, DeepFashion2, HumanParts, MOT17Det, MOT20Det, SKU-110K |
56
+ | Autonomous driving and robotics | BDD100K, EgoObjects, nuImages, PixMo Points, RoboAfford |
57
+ | GUI | GroundCUA, OS-Atlas, ScaleCUA |
58
+ | Text recognition | ArT, BLIP3-OCR, IDL-OCR, HierText, ICDAR 2013, ICDAR 2015, LSVT, RCTW, ReCTS, SROIE, TextOCR, WildReceipt |
59
+ | Documents, layouts, and tables | CDLA, DocLayNet, M6Doc, PubLayNet, TableBank, TabRecSet |
60
+
61
+ ### Spatial supervision
62
+
63
+ All records use a shared `query` representation:
64
+
65
+ | `task_type` | Query target | Typical use |
66
+ |---|---|---|
67
+ | `detection_grounding` | Bounding box `[x1, y1, x2, y2]` | Category detection, phrase grounding, GUI grounding, OCR, and layout localization |
68
+ | `pointing` | Point `[x, y]` | Point-based localization |
69
+ | `detection_grounding_pointing` | Boxes and points in one record | Affordance and mixed spatial supervision |
70
+
71
+ Coordinates use the LocateAnything normalized spatial grid and can be mapped
72
+ to image pixels with `x * width / 1000` and `y * height / 1000`.
73
+
74
+ ## Release format
75
+
76
+ Each dataset has its own folder and may contain one or more annotation
77
+ **views**. A view is a training annotation variant over a media source—for
78
+ example, COCO detection and RefCOCO grounding are separate views while sharing
79
+ the same underlying images.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  ```text
82
  LocateAnything-Data/
83
+ ├── metadataset.yaml
84
+ ├── metadataset-full.yaml
 
 
 
 
 
 
 
 
 
 
 
85
  ├── datasets/
86
  │ └── <dataset_id>/
87
  │ ├── metadataset.yaml
88
+ │ └── views/<view_id>/
89
+ │ ├── metadataset.yaml
90
+ │ ├── records.jsonl
91
+ │ └── records.jsonl.idx
 
92
  ├── media/
93
  │ └── <pool_id>/
94
+ │ ├── .nv-meta/
95
+ │ └── shards/
 
96
  │ ├── image-NNNNNNNN.tar
97
  │ └── image-NNNNNNNN.tar.idx
98
  ├── mappings/
99
+ │ ├── media/<pool_id>/part-*.parquet
100
+ │ └── views/<dataset_id>/<view_id>/part-*.parquet
 
 
 
101
  ├── examples/
 
 
102
  └── tools/
 
 
103
  ```
104
 
105
+ - `records.jsonl` keeps annotations easy to inspect and process.
106
+ - `records.jsonl.idx` stores byte offsets for direct row access.
107
+ - Uncompressed TAR shards preserve encoded image bytes and support indexed
108
+ reads without extracting millions of files.
109
+ - `.tar.idx` and `.nv-meta` are consumed by Megatron-Energon.
110
+ - Parquet mappings preserve record lineage and original media names.
111
 
112
+ ### Annotation record
 
 
113
 
114
+ Each JSONL line is one independent training record:
 
 
 
115
 
116
  ```json
117
  {
118
  "_source": {
119
+ "dataset_id": "coco",
120
+ "view_id": "locate_anything_coco_refcoco",
121
+ "sample_id": "coco:locate_anything_coco_refcoco:..."
 
 
 
 
 
122
  },
123
  "image": {
124
  "kind": "image",
125
  "source": "media_00",
126
+ "path": "m/000000012345.jpg"
127
  },
128
  "query": {
129
+ "the person holding an umbrella": [[124, 86, 612, 944]]
130
  },
131
  "task_type": "detection_grounding"
132
  }
133
  ```
134
 
135
+ `image.source` selects the auxiliary media pool declared by the view-level
136
+ `metadataset.yaml`. `image.path` is the exact member name inside the TAR.
 
 
 
137
 
138
+ ## Download
 
 
139
 
140
+ Install the Hugging Face CLI and download the repository:
141
+
142
+ ```bash
143
+ pip install -U huggingface_hub
144
+
145
+ hf download NVEagle/LocateAnything-Data \
146
+ --repo-type dataset \
147
+ --local-dir LocateAnything-Data
148
+
149
+ cd LocateAnything-Data
150
+ ```
151
+
152
+ Use `hf download ... --dry-run` or `--include` when you only need selected
153
+ datasets.
154
+
155
+ ## Inspect annotations
156
+
157
+ JSONL records can be previewed with standard command-line tools:
158
 
159
  ```bash
160
  sed -n '1,3p' \
161
+ datasets/coco/views/locate_anything_coco_refcoco/records.jsonl \
162
+ | jq .
163
  ```
164
 
165
+ Read a row by index without scanning the JSONL file:
166
 
167
  ```bash
168
  python examples/read_indexed_jsonl.py \
169
+ datasets/coco/views/locate_anything_coco_refcoco/records.jsonl \
170
  100
171
  ```
172
 
173
+ ## Visualize a sample
174
 
175
+ Install the runtime dependencies:
 
 
176
 
177
+ ```bash
178
+ pip install "megatron-energon==7.4.0" pillow
179
+ ```
 
 
 
180
 
181
+ The following example loads one sample through Energon and draws all boxes and
182
+ points:
183
+
184
+ ```python
185
+ from io import BytesIO
186
+ from pathlib import Path
187
+
188
+ from PIL import Image, ImageDraw
189
+ from megatron.energon import (
190
+ WorkerConfig,
191
+ get_savable_loader,
192
+ get_train_dataset,
193
+ )
194
+
195
+ from examples.read_energon import LocateAnythingTaskEncoder
196
+
197
+ dataset = get_train_dataset(
198
+ Path("datasets/ocr_icdar2013/metadataset.yaml"),
199
+ split_part="train",
200
+ worker_config=WorkerConfig(
201
+ rank=0, world_size=1, num_workers=0
202
+ ),
203
+ batch_size=None,
204
+ max_samples_per_sequence=1,
205
+ shuffle_over_epochs_multiplier=1,
206
+ shuffle_buffer_size=None,
207
+ task_encoder=LocateAnythingTaskEncoder(),
208
+ repeat=False,
209
+ )
210
+ sample = next(iter(get_savable_loader(dataset)))
211
+
212
+ image = Image.open(BytesIO(sample.image)).convert("RGB")
213
+ draw = ImageDraw.Draw(image)
214
+
215
+ def to_pixel(target):
216
+ values = list(target)
217
+ for i in range(0, len(values), 2):
218
+ values[i] = round(values[i] * image.width / 1000)
219
+ values[i + 1] = round(values[i + 1] * image.height / 1000)
220
+ return values
221
+
222
+ for label, targets in sample.record["query"].items():
223
+ for target in targets:
224
+ xy = to_pixel(target)
225
+ if len(xy) == 4:
226
+ draw.rectangle(xy, outline="red", width=3)
227
+ draw.text((xy[0], xy[1]), label, fill="red")
228
+ elif len(xy) == 2:
229
+ x, y = xy
230
+ draw.ellipse((x - 5, y - 5, x + 5, y + 5), fill="red")
231
+ draw.text((x + 6, y), label, fill="red")
232
+
233
+ image.save("sample.png")
234
+ ```
235
 
236
+ ## Read for training
237
 
238
+ The repository targets `megatron-energon==7.4.0`. Choose the entry point that
239
+ matches your training scope:
240
+
241
+ | Entry point | Purpose |
242
+ |---|---|
243
+ | `metadataset.yaml` | All datasets whose media is available directly in this repository |
244
+ | `metadataset-full.yaml` | The full mixture after locally adding the externally downloaded media |
245
+ | `datasets/<dataset_id>/metadataset.yaml` | One dataset |
246
+ | `datasets/<dataset_id>/views/<view_id>/metadataset.yaml` | One annotation view |
247
+
248
+ Run the included reader:
249
 
250
+ ```bash
251
+ python examples/read_energon.py \
252
+ datasets/coco/metadataset.yaml \
253
+ --workers 8 \
254
+ --samples 16
255
+ ```
256
+
257
+ `examples/read_energon.py` contains a minimal task encoder. It resolves the
258
+ record's media source, reads the encoded image directly from the indexed TAR,
259
+ and returns the annotation dictionary with image bytes.
260
+
261
+ ## Map a record back to its source image
262
+
263
+ Two Parquet relations connect each training record to its source image:
264
+
265
+ - `mappings/views/...` connects a JSONL row to a media `source_id`.
266
+ - `mappings/media/...` connects that `source_id` to the original
267
+ dataset-relative filename, file hash, and packed TAR member.
268
+
269
+ The authoritative join key is `(pool_id, source_id)`. For example:
270
+
271
+ ```sql
272
  SELECT
273
  v.row_id,
274
  v.source_sample_id,
 
283
  'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
284
  ) AS m
285
  USING (pool_id, source_id)
286
+ WHERE v.row_id = 100;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  ```
288
 
289
+ ## Media downloaded from upstream sources
 
 
 
 
 
 
290
 
291
+ Media from the following datasets must be obtained from the original source.
292
+ Their annotations and source-image mappings are included here.
293
 
294
+ | Dataset folder | Media source |
295
+ |---|---|
296
+ | `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) |
297
+ | `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) |
298
+ | `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) |
299
+ | `partimagenet` | [ImageNet](https://www.image-net.org/download.php) |
300
+ | `object365` | [Objects365](https://www.objects365.org/download.html) |
301
+ | `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) |
302
+ | `unsplash` | [Unsplash Dataset](https://unsplash.com/data) |
303
 
304
+ After downloading a source dataset with its original directory and filenames,
305
+ build the local media shards from the public mapping:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
 
307
  ```bash
308
  python tools/hydrate_restricted_media.py \
 
311
  --source-root /data/upstream/CrowdHuman
312
  ```
313
 
314
+ The tool verifies mapped files and creates the TAR indexes and Energon metadata
315
+ expected by `metadataset-full.yaml`.
316
+
317
+ ## License
318
+
319
+ LocateAnything-Data is assembled from multiple upstream datasets. Each
320
+ component remains subject to the license, terms of use, access requirements,
321
+ and attribution requirements of its original source. This repository does not
322
+ grant additional rights to upstream images. Review the corresponding upstream
323
+ terms before downloading, using, or redistributing a component.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  ## Citation
326
 
README_CN.md CHANGED
@@ -5,220 +5,259 @@ task_categories:
5
  tags:
6
  - visual-grounding
7
  - pointing
 
 
8
  - megatron-energon
9
  - webdataset
10
  - multimodal
11
- size_categories:
12
- - 10M<n<100M
13
  ---
14
 
15
  # LocateAnything-Data
16
 
17
- [English](README.md) | [Hugging Face 仓库](https://huggingface.co/datasets/NVEagle/LocateAnything-Data)
18
-
19
- > 官方发布仓库:
20
- > [`NVEagle/LocateAnything-Data`](https://huggingface.co/datasets/NVEagle/LocateAnything-Data)。
21
- > 本集合不声明一个覆盖全部内容的统一许可证。使用任何组成部分前,请查阅并
22
- > 遵守对应原始上游数据集的许可证和使用条款。
23
-
24
- LocateAnything-Data 是面向空间视觉语言训练的数据集合,使用可索引 JSONL 和
25
- Megatron-Energon 组织。任务只包括目标检测、visual grounding 和 pointing;
26
- 不包含 VQA、benchmark、test、validation、chat 或内部构建 provenance。
27
-
28
- 数据集总盘点如下:
29
-
30
- | 项目 | 数量 |
31
- |---|---:|
32
- | Dataset folder | 42 |
33
- | 标注 view | 47 |
34
- | 训练 record | 10,136,648 |
35
- | Canonical media pool | 41 |
36
- | 被引用的物理图片 | 总计 9,801,026;其中托管 7,402,667 |
37
- | Canonical TAR shard | 源盘点 926;其中托管 583 |
38
-
39
- OS-Atlas 已经属于这个统一的 42-dataset 发布,不再单独建立一份媒体仓库或重复
40
- 发布。
41
-
42
- ## 图片再分发边界
43
-
44
- 47 个标注 view 和脱敏后的 record-to-source-image mapping 都属于开源范围。
45
- 以下 7 个上游来源的图片不能随仓库再分发,使用者必须从官方入口自行取得并在
46
- 本地 hydrate:
47
-
48
- | 上游来源 | LocateAnything dataset ID | Canonical pool ID | Record | 官方入口 | 预期 source-relative path |
49
- |---|---|---|---:|---|---|
50
- | CrowdHuman | `crowdhuman` | `locany--crowdhuman--train--source_image--v000001` | 15,000 | [下载](https://www.crowdhuman.org/download.html) | `train/Images/<name>.jpg` |
51
- | DeepFashion2 | `deepfashion2` | `locany--deepfashion2--train--source_image--v000001` | 191,961 | [官方说明](https://github.com/switchablenorms/DeepFashion2)、[申请表](https://docs.google.com/forms/d/e/1FAIpQLSeIoGaFfCQILrtIZPykkr8q_h9qQ5BoTYbjvf95aXbid0v2Bw/viewform) | `train/image/000001.jpg` |
52
- | Flickr30K | `flickr30k` | `locany--flickr30k--train--source_image--v000001` | 29,781 | [官方页面](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) | `flickr30k-images/<flickr_id>.jpg` |
53
- | ImageNet | `partimagenet` | `locany--imagenet--train--source_image--v000001` | 100,000 | [下载/申请访问](https://www.image-net.org/download.php) | `train/<wnid>/<wnid>_*.JPEG` |
54
- | Objects365 | `object365` | `locany--object365--train--source_image--v000001` | 1,742,289 | [下载及条款](https://www.objects365.org/download.html) | `images/train/patch*/objects365_v1_*.jpg` |
55
- | SKU-110K | `sku110k` | `locany--sku110k--train--source_image--v000001` | 8,219 | [作者仓库](https://github.com/eg4000/SKU110K_CVPR19) | `images/train_*.jpg` |
56
- | Unsplash | `unsplash` | `locany--unsplash--train--source_image--v000001` | 329,721 | [数据入口](https://unsplash.com/data)、[Dataset Terms](https://github.com/unsplash/datasets/blob/master/TERMS.md) | `raw_unsplash_images/<photo_id>.jpg` |
57
-
58
- ImageNet 在这里是媒体来源,不是一个 LocateAnything dataset folder;使用它的标注
59
- 数据集是 `partimagenet`。Objects365 是上游官方名称,`object365` 只是
60
- LocateAnything 中的稳定 ID。
61
-
62
- 这 7 个来源覆盖 2,416,971 条 record、2,398,359 个物理图片和内部 343 个 TAR;
63
- 这些 TAR payload 一个都不会进入公开仓库。可以直接托管的其余部分包含 35 个
64
- dataset folder、7,719,677 条 record、34 个媒体池、7,402,667 个物理图片和
65
- 583 个 TAR。每个托管 TAR 在仓库里只有一个路径。
66
-
67
- 本仓库不是上述 7 个上游数据集的镜像,也不授予其媒体权利。使用者必须自行从
68
- 官方入口取得媒体、接受下载时有效的条款,并保持原始文件名和目录结构。
69
- Hydration 工具不会绕过注册、申请表、密码或访问控制。
70
-
71
- 补充下载说明:
72
-
73
- - CrowdHuman 需要下载 mapping 所引用的训练图片分卷;官网明确规定图片不得
74
- 再分发。
75
- - DeepFashion2 需要逐用户申请并取得压缩包密码;公开 mapping 引用
76
- `train/image`。
77
- - Flickr30K 图片继续受 Flickr 条款约束;官方项目另行提供可公开分发的图片链接
78
- 与 captions 版本。
79
- - ImageNet view 使用 ILSVRC 风格训练目录中的 100,000 张图片,不能把 synset
80
- 目录打平。
81
- - Objects365 应保留 V1/V2 包的文件名,并按官方标注中的 `file_name` 关联,
82
- 不能自行改名。
83
- - SKU-110K 应保持解压后的图片和 CSV 目录结构。
84
- - Unsplash Lite 不一定覆盖本 mapping 的 329,721 张图片。必须取得匹配的授权
85
- release 并用 SHA-256 校验,不能用同名或相似图片替换。
86
-
87
- ## 仓库组织
88
-
89
- 仓库对每个 payload 只保留一个 canonical 路径:
90
 
91
  ```text
92
  LocateAnything-Data/
93
- ├── .gitattributes
94
- ├── README.md
95
- ├── README_CN.md
96
- ├── release-policy.json
97
- ├── metadataset.yaml # 可立即读取的托管子集
98
- ├── metadataset-full.yaml # 本地补齐 7 个媒体池后的全集
99
- ├── manifests/
100
- │ ├── release.json
101
- │ ├── files.jsonl
102
- │ ├── datasets.jsonl
103
- │ ├── views.jsonl
104
- │ ├── media-pools.jsonl
105
- │ └── restricted-media.json
106
  ├── datasets/
107
  │ └── <dataset_id>/
108
  │ ├── metadataset.yaml
109
- │ └── views/
110
- │ └── <view_id>/
111
- │ ├── metadataset.yaml
112
- │ ├── records.jsonl
113
- │ └── records.jsonl.idx
114
  ├── media/
115
  │ └── <pool_id>/
116
- │ ├── availability.json
117
- │ ├── .nv-meta/ # 只存在于托管媒体池
118
- │ └── shards/ # 只存在于托管媒体池
119
  │ ├── image-NNNNNNNN.tar
120
  │ └── image-NNNNNNNN.tar.idx
121
  ├── mappings/
122
- │ ├── media/<pool_id>/part-NNNNN.parquet
123
- │ └── views/<dataset_id>/<view_id>/part-NNNNN.parquet
124
- ├── schemas/
125
- │ ├── media-source-map.schema.json
126
- │ └── view-source-map.schema.json
127
  ├── examples/
128
- │ ├── read_indexed_jsonl.py
129
- │ └── read_energon.py
130
  └── tools/
131
- ├── hydrate_restricted_media.py
132
- └── verify_release.py
133
  ```
134
 
135
- 仓库中禁止出现 `datasets/<dataset_id>/media/`。从
136
- `datasets/<dataset_id>/views/<view_id>/metadataset.yaml` 出发,每个 auxiliary
137
- 媒体路径必须精确写成 `../../../../media/<pool_id>`。7 个外部媒体池在使用者
138
- 本地 hydrate 前只有 `availability.json`。
139
-
140
- `metadataset.yaml` 混合 35 个图片已由 Hugging Face 托管的数据集;
141
- `metadataset-full.yaml` 混合全部 42 个数据集,在 7 个外部池全部 hydrate 并
142
- 通过校验前必须 fail fast。
143
 
144
- ## 标注格式
145
 
146
- 标注保持为方便预览的 JSON Lines,每行是一条独立训练 record。下面是删减后的
147
- schema 示例:
148
 
149
  ```json
150
  {
151
  "_source": {
152
- "schema": "eagle-energon.source-record/v1",
153
- "dataset_id": "crowdhuman",
154
- "view_id": "locate_anything_crowdhuman_crowdhuman",
155
- "sample_id": "crowdhuman:locate_anything_crowdhuman_crowdhuman:file:0009:row:000000000000",
156
- "source_annotation": "annotations/CrowdHuman/CrowdHuman.jsonl",
157
- "source_file_index": 9,
158
- "source_row": 0,
159
- "source_record_sha256": "<sha256>"
160
  },
161
  "image": {
162
  "kind": "image",
163
  "source": "media_00",
164
- "path": "m/000000000082.jpg"
165
  },
166
  "query": {
167
- "Person": [[1, 410, 168, 1000]]
168
  },
169
  "task_type": "detection_grounding"
170
  }
171
  ```
172
 
173
- `query` 中的值是数值点 `[x, y]` 或数值框 `[x1, y1, x2, y2]`,读取器不会
174
- 再次缩放或改写。`image.source` 选择 view 的 Energon auxiliary pool,
175
- `image.path` 是 TAR 中的精确 member name。禁止根据 packed member name 猜测
176
- 原始文件名。
177
 
178
- `records.jsonl.idx` 是 little-endian uint64 数组。N 条 record 对应 N+1 个
179
- uint64 offset(每个 8 字节),第 i 行范围为
180
- `[offset[i], offset[i + 1])`,因此可以 O(1) 定位。
181
 
182
- 预览:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
  ```bash
185
  sed -n '1,3p' \
186
- datasets/object365/views/locate_anything_object365_object365/records.jsonl \
187
- | jq -c .
188
  ```
189
 
190
- 不扫描整个文件、直接读取指定行:
191
 
192
  ```bash
193
  python examples/read_indexed_jsonl.py \
194
- datasets/object365/views/locate_anything_object365_object365/records.jsonl \
195
  100
196
  ```
197
 
198
- ## 公开 source-image mapping
199
 
200
- 公开仓库不包含内部 SQLite mapping,因为其中含有绝对路径和文件系统证据。
201
- 公开版使用两张规范化、Zstandard 压缩的 Parquet 关系表:
202
 
203
- 1. `mappings/media/<pool_id>/...`:每个上游 source-image alias 一行,把原始
204
- dataset-relative 文件名/路径及 SHA-256 映射到 canonical `member_name` 和
205
- content SHA-256。
206
- 2. `mappings/views/<dataset_id>/<view_id>/...`:每个 record-media occurrence
207
- 一行,把 record lineage 和 JSON pointer 映射到精确的 pool-local
208
- `source_id` 及 canonical member。
209
 
210
- 第二张表不可省略,因为字节完全相同的图片可能有多个上游文件名。只根据
211
- `member_name` 反查会产生歧义;唯一权威 join key 是
212
- `(pool_id, source_id)`。
213
- `source_snapshot_id` 表示转换/source-manifest snapshot,不能把它解释为
214
- 上游数据集的 release 名称。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
- 从第 12,911 行 record 找回精确上游图片:
217
 
218
- ```sql
219
- INSTALL parquet;
220
- LOAD parquet;
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  SELECT
223
  v.row_id,
224
  v.source_sample_id,
@@ -233,54 +272,26 @@ JOIN read_parquet(
233
  'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
234
  ) AS m
235
  USING (pool_id, source_id)
236
- WHERE v.row_id = 12911;
237
  ```
238
 
239
- 从原始路径反查所有 LocateAnything record:
240
 
241
- ```sql
242
- SELECT v.dataset_id, v.view_id, v.row_id, v.source_sample_id
243
- FROM read_parquet(
244
- 'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
245
- ) AS m
246
- JOIN read_parquet(
247
- 'mappings/views/crowdhuman/locate_anything_crowdhuman_crowdhuman/*.parquet'
248
- ) AS v
249
- USING (pool_id, source_id)
250
- WHERE m.source_relative_path =
251
- 'train/Images/273271,1017c000ac1360b7.jpg';
252
- ```
253
 
254
- 公开 mapping 保留原始 source 文件名,不使用 LMDB key 或 packed member 冒充
255
- 原始名字。mapping 绝不包含 `source_absolute_path`、内部 annotation 路径、
256
- Lustre 路径、用户名、inode/device、软链接目标、token、cookie 或 signed URL。
257
- 精确字段见 `schemas/`。
 
 
 
 
 
258
 
259
- ## 使用 Megatron-Energon 读取
260
-
261
- 格式绑定 `megatron-energon==7.4.0`:
262
-
263
- - 直接可读的托管子集使用 `metadataset.yaml`;
264
- - 7 个外部池全部 hydrate 后使用 `metadataset-full.yaml`;
265
- - 单数据集使用 `datasets/<dataset_id>/metadataset.yaml`;
266
- - 调试单 view 时使用对应 view 的 `metadataset.yaml`。
267
-
268
- 该结构支持 JSONL 随机索引、未压缩 TAR 随机索引、多 worker、按 rank 切分和
269
- stream packing。完全无放回的 sample-level permutation 应使用
270
- `max_samples_per_sequence=1`、单 epoch shuffle multiplier,并关闭第二层
271
- shuffle buffer;packing 放在样本随机化之后执行。
272
-
273
- 仓库在 `examples/read_energon.py` 中提供轻量 task encoder 和可运行的 loader:
274
-
275
- ```bash
276
- python examples/read_energon.py metadataset.yaml --workers 8 --samples 3
277
- ```
278
-
279
- 外部媒体池缺失必须报错,训练代码不得静默跳过 record。
280
-
281
- ## 本地补齐 7 个外部媒体池
282
-
283
- Hydrator 只以公开 mapping 作为文件清单:
284
 
285
  ```bash
286
  python tools/hydrate_restricted_media.py \
@@ -289,40 +300,14 @@ python tools/hydrate_restricted_media.py \
289
  --source-root /data/upstream/CrowdHuman
290
  ```
291
 
292
- 它会对每个 source image:
293
-
294
- 1. 精确解析 `source_relative_path`,禁止只按 basename 猜测;
295
- 2. 校验字节数和 SHA-256;
296
- 3. 保持稳定的 `member_name`;
297
- 4. 在 canonical pool 内按内容去重;
298
- 5. 写约 4 GiB 的未压缩 TAR;
299
- 6. 生成 `.tar.idx` 和官方 Energon `.nv-meta`;
300
- 7. 验证全部 annotation reference;
301
- 8. 写本地 hydration receipt。
302
-
303
- Hydrate 生成的媒体只能保留在本地,绝不能回传 Hugging Face。
304
-
305
- ## Canonical 存储与去重
306
-
307
- - `NVEagle/LocateAnything-Data` 是本集合唯一的 canonical Hugging Face
308
- dataset repository。
309
- - 每个 canonical TAR 在仓库中只有一个
310
- `media/<pool_id>/shards/` 路径。
311
- - 仓库不包含 dataset-local media projection。
312
- - OS-Atlas 属于统一 catalog,不存在单独副本。
313
- - `manifests/files.jsonl` 覆盖除其自身以外的全部发布对象,每个 canonical
314
- 仓库路径恰好对应一行。
315
-
316
- Hugging Face Xet 可以在内部进行 chunk-level dedup;这不改变上述路径级存储
317
- 约束。
318
 
319
- ## 许可与上游条款
320
 
321
- LocateAnything-Data 汇集了来自多个上游数据集的标注和引用,因此本仓库不选择、
322
- 也不暗示一个适用于全部组成部分的统一许可证。每个上游数据集仍受其各自的
323
- 许可证、使用条款、访问条件和署名要求约束。下载、hydrate、使用或再分发任何
324
- 组成部分前,使用者必须查阅本 README 中链接的官方上游来源并遵守适用条款。
325
- 本仓库不授予任何额外的上游媒体权利。
326
 
327
  ## 引用
328
 
 
5
  tags:
6
  - visual-grounding
7
  - pointing
8
+ - document-layout-analysis
9
+ - gui-grounding
10
  - megatron-energon
11
  - webdataset
12
  - multimodal
 
 
13
  ---
14
 
15
  # LocateAnything-Data
16
 
17
+ [English](README.md) · [论文](https://arxiv.org/abs/2605.27365) ·
18
+ [模型](https://huggingface.co/nvidia/LocateAnything-3B) ·
19
+ [代码](https://github.com/NVlabs/Eagle/tree/main/Embodied)
20
+
21
+ ## 简介
22
+
23
+ LocateAnything-Data 是
24
+ **LocateAnything: Fast and High-Quality Vision-Language Grounding with
25
+ Parallel Box Decoding** 的公开训练数据。
26
+
27
+ LocateAnything 将目标检测和视觉定位统一为视觉语言任务:给定图片,以及类别、
28
+ 描述短语、文本内容或动作指令,模型预测相应的边界框或点。数据覆盖自然图像、
29
+ 密集场景、人物、自动驾驶、具身交互、图形界面、场景文字、文档和表格。
30
+
31
+ 论文提出的 Parallel Box Decoding 将一个框或点作为完整的几何单元,而不是分别
32
+ 生成各个坐标。LocateAnything-Data 为这一统一任务提供跨视觉领域的多样化空间
33
+ 监督。
34
+
35
+ 本仓库提供:
36
+
37
+ - 使用 JSONL 保存、方便预览的检测、grounding 和 pointing 标注;
38
+ - 使用带索引的 WebDataset TAR 保存的图片;
39
+ - 用于分布式训练的 Megatron-Energon 元数据;
40
+ - 从每条训练标注和打包图片回溯到原始数据集相对路径的公开 mapping。
41
+
42
+ ## 数据范围
43
+
44
+ 下表按照主要视觉领域组织数据。部分数据集天然覆盖多个领域或任务。
45
+
46
+ | 领域 | 包含的数据集 |
47
+ |---|---|
48
+ | 通用检测与 Grounding | COCO、RefCOCO、RefCOCO+、RefCOCOg、G-RefCOCO、Flickr30K、HumanRef-CoT、Objects365、Open Images V6、OWDOD、PACO、PartImageNet、Unsplash、V3Det |
49
+ | 密集目标检测 | CrowdHuman、DeepFashion2、HumanParts、MOT17Det、MOT20Det、SKU-110K |
50
+ | 自动驾驶和机器人 | BDD100K、EgoObjects、nuImages、PixMo Points、RoboAfford |
51
+ | GUI | GroundCUA、OS-Atlas、ScaleCUA |
52
+ | 文字识别 | ArT、BLIP3-OCR、IDL-OCR、HierText、ICDAR 2013、ICDAR 2015、LSVT、RCTW、ReCTS、SROIE、TextOCR、WildReceipt |
53
+ | 文档、版面与表格 | CDLA、DocLayNet、M6Doc、PubLayNet、TableBank、TabRecSet |
54
+
55
+ ### 空间监督类型
56
+
57
+ 所有标注使用统一的 `query` 表达:
58
+
59
+ | `task_type` | 标注目标 | 典型用途 |
60
+ |---|---|---|
61
+ | `detection_grounding` | 边界框 `[x1, y1, x2, y2]` | 类别检测、短语定位、GUI 定位、OCR 和版面定位 |
62
+ | `pointing` | 点 `[x, y]` | 基于点的目标定位 |
63
+ | `detection_grounding_pointing` | 同一条标注中的框和点 | Affordance 和混合空间监督 |
64
+
65
+ 坐标使用 LocateAnything 的归一化空间网格。映射到图片像素时使用
66
+ `x * width / 1000` 和 `y * height / 1000`。
67
+
68
+ ## 开源格式
69
+
70
+ 每个数据集都有独立目录,并且可以包含一个或多个标注 **view**。View 表示同一
71
+ 媒体源上的一种训练标注,例如 COCO detection 和 RefCOCO grounding 是不同
72
+ view,但可以共享底层图片。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  ```text
75
  LocateAnything-Data/
76
+ ├── metadataset.yaml
77
+ ├── metadataset-full.yaml
 
 
 
 
 
 
 
 
 
 
 
78
  ├── datasets/
79
  │ └── <dataset_id>/
80
  │ ├── metadataset.yaml
81
+ │ └── views/<view_id>/
82
+ │ ├── metadataset.yaml
83
+ │ ├── records.jsonl
84
+ │ └── records.jsonl.idx
 
85
  ├── media/
86
  │ └── <pool_id>/
87
+ │ ├── .nv-meta/
88
+ │ └── shards/
 
89
  │ ├── image-NNNNNNNN.tar
90
  │ └── image-NNNNNNNN.tar.idx
91
  ├── mappings/
92
+ │ ├── media/<pool_id>/part-*.parquet
93
+ │ └── views/<dataset_id>/<view_id>/part-*.parquet
 
 
 
94
  ├── examples/
 
 
95
  └── tools/
 
 
96
  ```
97
 
98
+ - `records.jsonl` 便于直接查看和处理标注。
99
+ - `records.jsonl.idx` 保存字节偏移,可以直接定位任意一行。
100
+ - 未压缩 TAR 保留图片的原始编码字节,可以索引读取,无需解压成海量小文件。
101
+ - `.tar.idx` 和 `.nv-meta` 供 Megatron-Energon 使用。
102
+ - Parquet mapping 保存标注来源和原始媒体文件名。
 
 
 
103
 
104
+ ### 标注格式
105
 
106
+ JSONL 中的每一行是一条独立训练标注:
 
107
 
108
  ```json
109
  {
110
  "_source": {
111
+ "dataset_id": "coco",
112
+ "view_id": "locate_anything_coco_refcoco",
113
+ "sample_id": "coco:locate_anything_coco_refcoco:..."
 
 
 
 
 
114
  },
115
  "image": {
116
  "kind": "image",
117
  "source": "media_00",
118
+ "path": "m/000000012345.jpg"
119
  },
120
  "query": {
121
+ "the person holding an umbrella": [[124, 86, 612, 944]]
122
  },
123
  "task_type": "detection_grounding"
124
  }
125
  ```
126
 
127
+ `image.source` 选择 view 级 `metadataset.yaml` 声明的辅助媒体池,
128
+ `image.path` 是 TAR 内部的精确 member name。
 
 
129
 
130
+ ## 下载
 
 
131
 
132
+ 安装 Hugging Face CLI 并下载仓库:
133
+
134
+ ```bash
135
+ pip install -U huggingface_hub
136
+
137
+ hf download NVEagle/LocateAnything-Data \
138
+ --repo-type dataset \
139
+ --local-dir LocateAnything-Data
140
+
141
+ cd LocateAnything-Data
142
+ ```
143
+
144
+ 如果只需要部分数据集,可以先使用 `hf download ... --dry-run` 查看内容,并用
145
+ `--include` 选择路径。
146
+
147
+ ## 查看标注
148
+
149
+ JSONL 可以直接使用常见命令行工具预览:
150
 
151
  ```bash
152
  sed -n '1,3p' \
153
+ datasets/coco/views/locate_anything_coco_refcoco/records.jsonl \
154
+ | jq .
155
  ```
156
 
157
+ 通过索引读取指定行,不需要扫描 JSONL:
158
 
159
  ```bash
160
  python examples/read_indexed_jsonl.py \
161
+ datasets/coco/views/locate_anything_coco_refcoco/records.jsonl \
162
  100
163
  ```
164
 
165
+ ## 可视化样本
166
 
167
+ 安装运行依赖:
 
168
 
169
+ ```bash
170
+ pip install "megatron-energon==7.4.0" pillow
171
+ ```
 
 
 
172
 
173
+ 下面的示例通过 Energon 读取一个样本,并绘制其中的所有框和点:
174
+
175
+ ```python
176
+ from io import BytesIO
177
+ from pathlib import Path
178
+
179
+ from PIL import Image, ImageDraw
180
+ from megatron.energon import (
181
+ WorkerConfig,
182
+ get_savable_loader,
183
+ get_train_dataset,
184
+ )
185
+
186
+ from examples.read_energon import LocateAnythingTaskEncoder
187
+
188
+ dataset = get_train_dataset(
189
+ Path("datasets/ocr_icdar2013/metadataset.yaml"),
190
+ split_part="train",
191
+ worker_config=WorkerConfig(
192
+ rank=0, world_size=1, num_workers=0
193
+ ),
194
+ batch_size=None,
195
+ max_samples_per_sequence=1,
196
+ shuffle_over_epochs_multiplier=1,
197
+ shuffle_buffer_size=None,
198
+ task_encoder=LocateAnythingTaskEncoder(),
199
+ repeat=False,
200
+ )
201
+ sample = next(iter(get_savable_loader(dataset)))
202
+
203
+ image = Image.open(BytesIO(sample.image)).convert("RGB")
204
+ draw = ImageDraw.Draw(image)
205
+
206
+ def to_pixel(target):
207
+ values = list(target)
208
+ for i in range(0, len(values), 2):
209
+ values[i] = round(values[i] * image.width / 1000)
210
+ values[i + 1] = round(values[i + 1] * image.height / 1000)
211
+ return values
212
+
213
+ for label, targets in sample.record["query"].items():
214
+ for target in targets:
215
+ xy = to_pixel(target)
216
+ if len(xy) == 4:
217
+ draw.rectangle(xy, outline="red", width=3)
218
+ draw.text((xy[0], xy[1]), label, fill="red")
219
+ elif len(xy) == 2:
220
+ x, y = xy
221
+ draw.ellipse((x - 5, y - 5, x + 5, y + 5), fill="red")
222
+ draw.text((x + 6, y), label, fill="red")
223
+
224
+ image.save("sample.png")
225
+ ```
226
 
227
+ ## 训练读取
228
 
229
+ 本仓库使用 `megatron-energon==7.4.0`。根据训练范围选择入口:
 
 
230
 
231
+ | 入口 | 用途 |
232
+ |---|---|
233
+ | `metadataset.yaml` | 直接包含在本仓库中的全部媒体和标注 |
234
+ | `metadataset-full.yaml` | 在本地补齐需要从上游下载的媒体后使用全集 |
235
+ | `datasets/<dataset_id>/metadataset.yaml` | 读取单个数据集 |
236
+ | `datasets/<dataset_id>/views/<view_id>/metadataset.yaml` | 读取单个标注 view |
237
+
238
+ 运行仓库提供的 reader:
239
+
240
+ ```bash
241
+ python examples/read_energon.py \
242
+ datasets/coco/metadataset.yaml \
243
+ --workers 8 \
244
+ --samples 16
245
+ ```
246
+
247
+ `examples/read_energon.py` 包含一个最小 task encoder。它根据标注解析媒体源,
248
+ 从带索引的 TAR 中直接读取编码图片,并返回标注字典和图片字节。
249
+
250
+ ## 从训练标注找回原始图片
251
+
252
+ 两组 Parquet 关系把每条训练标注关联到对应的原始图片:
253
+
254
+ - `mappings/views/...`:把 JSONL 行关联到媒体 `source_id`。
255
+ - `mappings/media/...`:把 `source_id` 关联到原始数据集相对路径、文件哈希和
256
+ TAR member。
257
+
258
+ 权威 join key 是 `(pool_id, source_id)`。例如:
259
+
260
+ ```sql
261
  SELECT
262
  v.row_id,
263
  v.source_sample_id,
 
272
  'mappings/media/locany--crowdhuman--train--source_image--v000001/*.parquet'
273
  ) AS m
274
  USING (pool_id, source_id)
275
+ WHERE v.row_id = 100;
276
  ```
277
 
278
+ ## 需要从上游下载的媒体
279
 
280
+ 以下数据集的媒体需要从原始来源获取;对应的标注和 source-image mapping 已经
281
+ 包含在本仓库中。
 
 
 
 
 
 
 
 
 
 
282
 
283
+ | 数据集目录 | 媒体来源 |
284
+ |---|---|
285
+ | `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) |
286
+ | `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) |
287
+ | `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) |
288
+ | `partimagenet` | [ImageNet](https://www.image-net.org/download.php) |
289
+ | `object365` | [Objects365](https://www.objects365.org/download.html) |
290
+ | `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) |
291
+ | `unsplash` | [Unsplash Dataset](https://unsplash.com/data) |
292
 
293
+ 下载上游数据并保留原始目录和文件名后,可以根据公开 mapping 构建本地媒体
294
+ shard:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
 
296
  ```bash
297
  python tools/hydrate_restricted_media.py \
 
300
  --source-root /data/upstream/CrowdHuman
301
  ```
302
 
303
+ 工具会校验 mapping 引用的文件,并生成 `metadataset-full.yaml` 所需的 TAR
304
+ 索引和 Energon 元数据。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
 
306
+ ## License
307
 
308
+ LocateAnything-Data 由多个上游数据集组成。每个组成部分仍受其原始来源的
309
+ license、使用条款、访问要求和署名要求约束。本仓库不授予额外的上游图片权利。
310
+ 下载、使用或再分发某个组成部分前,请查阅并遵守相应的上游条款。
 
 
311
 
312
  ## 引用
313
 
manifests/files.jsonl CHANGED
The diff for this file is too large to render. See raw diff