Document upstream media hydration workflow
Browse files- README.md +41 -15
- README_CN.md +37 -15
- manifests/files.jsonl +1 -1
README.md
CHANGED
|
@@ -288,20 +288,30 @@ WHERE v.row_id = 100;
|
|
| 288 |
## Media downloaded from upstream sources
|
| 289 |
|
| 290 |
Media from the following datasets must be obtained from the original source.
|
| 291 |
-
|
|
|
|
| 292 |
|
| 293 |
-
| Dataset folder |
|
| 294 |
-
|---|---|
|
| 295 |
-
| `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) |
|
| 296 |
-
| `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) |
|
| 297 |
-
| `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) |
|
| 298 |
-
| `partimagenet` | [ImageNet](https://www.image-net.org/download.php) |
|
| 299 |
-
| `object365` | [Objects365](https://www.objects365.org/download.html) |
|
| 300 |
-
| `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) |
|
| 301 |
-
| `unsplash` | [Unsplash Dataset](https://unsplash.com/data) |
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
```bash
|
| 307 |
python tools/hydrate_restricted_media.py \
|
|
@@ -310,8 +320,24 @@ python tools/hydrate_restricted_media.py \
|
|
| 310 |
--source-root /data/upstream/CrowdHuman
|
| 311 |
```
|
| 312 |
|
| 313 |
-
|
| 314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
|
| 316 |
## License Information
|
| 317 |
|
|
|
|
| 288 |
## Media downloaded from upstream sources
|
| 289 |
|
| 290 |
Media from the following datasets must be obtained from the original source.
|
| 291 |
+
This repository includes their annotations, JSONL indexes, source-image
|
| 292 |
+
mappings, and metadataset configuration, but not their image files.
|
| 293 |
|
| 294 |
+
| Dataset folder | Download images from | Expected path under `--source-root` |
|
| 295 |
+
|---|---|---|
|
| 296 |
+
| `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) | `train/Images/<image>.jpg` |
|
| 297 |
+
| `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) | `train/image/<six-digit-id>.jpg` |
|
| 298 |
+
| `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) | `flickr30k-images/<flickr-id>.jpg` |
|
| 299 |
+
| `partimagenet` | [ImageNet](https://www.image-net.org/download.php) | `train/<wnid>/<wnid>_<id>.JPEG` |
|
| 300 |
+
| `object365` | [Objects365](https://www.objects365.org/download.html) | `images/train/patch*/objects365_v1_<id>.jpg` |
|
| 301 |
+
| `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) | `images/train_<id>.jpg` |
|
| 302 |
+
| `unsplash` | [Unsplash Dataset](https://unsplash.com/data) | `raw_unsplash_images/<photo-id>.jpg` |
|
| 303 |
+
|
| 304 |
+
`metadataset.yaml` reads the datasets whose images are already hosted in this
|
| 305 |
+
repository. Use `metadataset-full.yaml` only after all media listed above has
|
| 306 |
+
been prepared locally.
|
| 307 |
+
|
| 308 |
+
### Prepare an upstream media dataset
|
| 309 |
+
|
| 310 |
+
1. Download the images from the official source and accept its terms.
|
| 311 |
+
2. Keep the upstream filenames and arrange the files under a source root using
|
| 312 |
+
the layout shown above.
|
| 313 |
+
3. Install `megatron-energon==7.4.0`.
|
| 314 |
+
4. Run the hydration tool with the matching dataset ID and source root.
|
| 315 |
|
| 316 |
```bash
|
| 317 |
python tools/hydrate_restricted_media.py \
|
|
|
|
| 320 |
--source-root /data/upstream/CrowdHuman
|
| 321 |
```
|
| 322 |
|
| 323 |
+
Run this once for each of the seven dataset folders, changing `--dataset` and
|
| 324 |
+
`--source-root` each time. The accepted dataset IDs are:
|
| 325 |
+
|
| 326 |
+
```text
|
| 327 |
+
crowdhuman
|
| 328 |
+
deepfashion2
|
| 329 |
+
flickr30k
|
| 330 |
+
partimagenet
|
| 331 |
+
object365
|
| 332 |
+
sku110k
|
| 333 |
+
unsplash
|
| 334 |
+
```
|
| 335 |
+
|
| 336 |
+
The tool uses `mappings/media/<pool_id>/part-*.parquet` as the file inventory.
|
| 337 |
+
It resolves every `source_relative_path` under `--source-root`, verifies the
|
| 338 |
+
file, and builds the local TAR indexes and Energon metadata required by
|
| 339 |
+
`metadataset-full.yaml`. The tool prepares local media only; upstream downloads
|
| 340 |
+
must be completed separately.
|
| 341 |
|
| 342 |
## License Information
|
| 343 |
|
README_CN.md
CHANGED
|
@@ -276,21 +276,28 @@ WHERE v.row_id = 100;
|
|
| 276 |
|
| 277 |
## 需要从上游下载的媒体
|
| 278 |
|
| 279 |
-
以下数据集的
|
| 280 |
-
包含
|
| 281 |
|
| 282 |
-
| 数据集目录 |
|
| 283 |
-
|---|---|
|
| 284 |
-
| `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) |
|
| 285 |
-
| `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) |
|
| 286 |
-
| `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) |
|
| 287 |
-
| `partimagenet` | [ImageNet](https://www.image-net.org/download.php) |
|
| 288 |
-
| `object365` | [Objects365](https://www.objects365.org/download.html) |
|
| 289 |
-
| `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) |
|
| 290 |
-
| `unsplash` | [Unsplash Dataset](https://unsplash.com/data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
-
下载
|
| 293 |
-
|
|
|
|
|
|
|
| 294 |
|
| 295 |
```bash
|
| 296 |
python tools/hydrate_restricted_media.py \
|
|
@@ -299,8 +306,23 @@ python tools/hydrate_restricted_media.py \
|
|
| 299 |
--source-root /data/upstream/CrowdHuman
|
| 300 |
```
|
| 301 |
|
| 302 |
-
|
| 303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
|
| 305 |
## License Information
|
| 306 |
|
|
|
|
| 276 |
|
| 277 |
## 需要从上游下载的媒体
|
| 278 |
|
| 279 |
+
以下数据集的图片需要从原始来源获取。本仓库已经包含它们的标注、JSONL 索引、
|
| 280 |
+
source-image mapping 和 metadataset 配置,但不包含图片文件。
|
| 281 |
|
| 282 |
+
| 数据集目录 | 图片下载入口 | `--source-root` 下的预期路径 |
|
| 283 |
+
|---|---|---|
|
| 284 |
+
| `crowdhuman` | [CrowdHuman](https://www.crowdhuman.org/download.html) | `train/Images/<image>.jpg` |
|
| 285 |
+
| `deepfashion2` | [DeepFashion2](https://github.com/switchablenorms/DeepFashion2) | `train/image/<six-digit-id>.jpg` |
|
| 286 |
+
| `flickr30k` | [Flickr30K](https://shannon.cs.illinois.edu/DenotationGraph/data/index.html) | `flickr30k-images/<flickr-id>.jpg` |
|
| 287 |
+
| `partimagenet` | [ImageNet](https://www.image-net.org/download.php) | `train/<wnid>/<wnid>_<id>.JPEG` |
|
| 288 |
+
| `object365` | [Objects365](https://www.objects365.org/download.html) | `images/train/patch*/objects365_v1_<id>.jpg` |
|
| 289 |
+
| `sku110k` | [SKU-110K](https://github.com/eg4000/SKU110K_CVPR19) | `images/train_<id>.jpg` |
|
| 290 |
+
| `unsplash` | [Unsplash Dataset](https://unsplash.com/data) | `raw_unsplash_images/<photo-id>.jpg` |
|
| 291 |
+
|
| 292 |
+
`metadataset.yaml` 读取图片已经包含在本仓库中的数据集。只有在本地补齐上述
|
| 293 |
+
全部媒体后,才使用 `metadataset-full.yaml`。
|
| 294 |
+
|
| 295 |
+
### 准备一个上游媒体数据集
|
| 296 |
|
| 297 |
+
1. 从官方入口下载图片并接受相应条款。
|
| 298 |
+
2. 保留上游文件名,并按照上表结构放到一个 source root 下。
|
| 299 |
+
3. 安装 `megatron-energon==7.4.0`。
|
| 300 |
+
4. 使用对应的数据集 ID 和 source root 运行 hydration 工具。
|
| 301 |
|
| 302 |
```bash
|
| 303 |
python tools/hydrate_restricted_media.py \
|
|
|
|
| 306 |
--source-root /data/upstream/CrowdHuman
|
| 307 |
```
|
| 308 |
|
| 309 |
+
对七个数据集目录分别运行一次,并相应修改 `--dataset` 和 `--source-root`。
|
| 310 |
+
可用的数据集 ID 为:
|
| 311 |
+
|
| 312 |
+
```text
|
| 313 |
+
crowdhuman
|
| 314 |
+
deepfashion2
|
| 315 |
+
flickr30k
|
| 316 |
+
partimagenet
|
| 317 |
+
object365
|
| 318 |
+
sku110k
|
| 319 |
+
unsplash
|
| 320 |
+
```
|
| 321 |
+
|
| 322 |
+
工具使用 `mappings/media/<pool_id>/part-*.parquet` 作为文件清单,在
|
| 323 |
+
`--source-root` 下解析每个 `source_relative_path`,校验文件,并生成
|
| 324 |
+
`metadataset-full.yaml` 所需的本地 TAR 索引和 Energon 元数据。该工具只负责
|
| 325 |
+
准备本地媒体,上游图片需要预先自行下载。
|
| 326 |
|
| 327 |
## License Information
|
| 328 |
|
manifests/files.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 295285
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd852c49255aae32ef41bb5152bddc6f29fd0b5ecb5e14389e2f3a130efd9f7a
|
| 3 |
size 295285
|