Rewrite dataset card around data domains and usage
Browse files- README.md +231 -251
- README_CN.md +216 -231
- 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 |
-
[中文
|
| 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 |
-
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 |
-
├── .
|
| 101 |
-
├──
|
| 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 |
-
│
|
| 118 |
-
│
|
| 119 |
-
│
|
| 120 |
-
│ └── records.jsonl.idx
|
| 121 |
├── media/
|
| 122 |
│ └── <pool_id>/
|
| 123 |
-
│ ├──
|
| 124 |
-
│
|
| 125 |
-
│ └── shards/ # present only for hosted media
|
| 126 |
│ ├── image-NNNNNNNN.tar
|
| 127 |
│ └── image-NNNNNNNN.tar.idx
|
| 128 |
├── mappings/
|
| 129 |
-
│ ├── media/<pool_id>/part-
|
| 130 |
-
│ └── views/<dataset_id>/<view_id>/part-
|
| 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 |
-
|
| 143 |
-
`
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
| 146 |
|
| 147 |
-
|
| 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 |
-
|
| 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 |
-
"
|
| 160 |
-
"
|
| 161 |
-
"
|
| 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/
|
| 172 |
},
|
| 173 |
"query": {
|
| 174 |
-
"
|
| 175 |
},
|
| 176 |
"task_type": "detection_grounding"
|
| 177 |
}
|
| 178 |
```
|
| 179 |
|
| 180 |
-
`
|
| 181 |
-
`
|
| 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 |
-
|
| 187 |
-
for `N` records. Row `i` occupies
|
| 188 |
-
`[offset[i], offset[i + 1])`, enabling O(1) indexed record access.
|
| 189 |
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
```bash
|
| 193 |
sed -n '1,3p' \
|
| 194 |
-
datasets/
|
| 195 |
-
| jq
|
| 196 |
```
|
| 197 |
|
| 198 |
-
Read
|
| 199 |
|
| 200 |
```bash
|
| 201 |
python examples/read_indexed_jsonl.py \
|
| 202 |
-
datasets/
|
| 203 |
100
|
| 204 |
```
|
| 205 |
|
| 206 |
-
##
|
| 207 |
|
| 208 |
-
|
| 209 |
-
which include absolute paths and filesystem evidence. Instead, it contains two
|
| 210 |
-
normalized, Zstandard-compressed Parquet relations:
|
| 211 |
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 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
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
`
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
-
|
| 226 |
|
| 227 |
-
``
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 =
|
| 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 |
-
|
| 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 |
-
|
|
|
|
| 272 |
|
| 273 |
-
|
| 274 |
-
-
|
| 275 |
-
|
| 276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
| 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 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 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)
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
LocateAnything-
|
| 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 |
-
- 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 |
-
├── .
|
| 94 |
-
├──
|
| 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 |
-
│
|
| 111 |
-
│
|
| 112 |
-
│
|
| 113 |
-
│ └── records.jsonl.idx
|
| 114 |
├── media/
|
| 115 |
│ └── <pool_id>/
|
| 116 |
-
│ ├──
|
| 117 |
-
│
|
| 118 |
-
│ └── shards/ # 只存在于托管媒体池
|
| 119 |
│ ├── image-NNNNNNNN.tar
|
| 120 |
│ └── image-NNNNNNNN.tar.idx
|
| 121 |
├── mappings/
|
| 122 |
-
│ ├── media/<pool_id>/part-
|
| 123 |
-
│ └── views/<dataset_id>/<view_id>/part-
|
| 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 |
-
|
| 136 |
-
`
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
`metadataset.yaml` 混合 35 个图片已由 Hugging Face 托管的数据集;
|
| 141 |
-
`metadataset-full.yaml` 混合全部 42 个数据集,在 7 个外部池全部 hydrate 并
|
| 142 |
-
通过校验前必须 fail fast。
|
| 143 |
|
| 144 |
-
## 标注格式
|
| 145 |
|
| 146 |
-
|
| 147 |
-
schema 示例:
|
| 148 |
|
| 149 |
```json
|
| 150 |
{
|
| 151 |
"_source": {
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
-
"
|
| 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/
|
| 165 |
},
|
| 166 |
"query": {
|
| 167 |
-
"
|
| 168 |
},
|
| 169 |
"task_type": "detection_grounding"
|
| 170 |
}
|
| 171 |
```
|
| 172 |
|
| 173 |
-
`
|
| 174 |
-
|
| 175 |
-
`image.path` 是 TAR 中的精确 member name。禁止根据 packed member name 猜测
|
| 176 |
-
原始文件名。
|
| 177 |
|
| 178 |
-
|
| 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/
|
| 187 |
-
| jq
|
| 188 |
```
|
| 189 |
|
| 190 |
-
|
| 191 |
|
| 192 |
```bash
|
| 193 |
python examples/read_indexed_jsonl.py \
|
| 194 |
-
datasets/
|
| 195 |
100
|
| 196 |
```
|
| 197 |
|
| 198 |
-
##
|
| 199 |
|
| 200 |
-
|
| 201 |
-
公开版使用两张规范化、Zstandard 压缩的 Parquet 关系表:
|
| 202 |
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 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 |
-
|
| 212 |
-
`
|
| 213 |
-
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
-
|
| 217 |
|
| 218 |
-
``
|
| 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 =
|
| 237 |
```
|
| 238 |
|
| 239 |
-
|
| 240 |
|
| 241 |
-
|
| 242 |
-
|
| 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 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
|
| 259 |
-
|
| 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 |
-
|
| 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 |
-
|
| 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
|
|
|