xxxspatialencoderwds5 commited on
Commit
cf2bdb4
·
verified ·
1 Parent(s): 8c4a615

Upload README for frame WebDataset directories

Browse files
Files changed (1) hide show
  1. README.md +74 -85
README.md CHANGED
@@ -1,95 +1,84 @@
1
- ---
2
- pretty_name: SpatialEncoder native WebDataset shards
3
- task_categories:
4
- - object-detection
5
- ---
6
-
7
- # SpatialEncoder WDS release (in progress)
8
-
9
- This repository contains a partition of `spatialencoder-wds-native-v1`, released
10
- as **uncompressed WebDataset tar shards**, normally about 1 GiB. All five
11
- repositories are parts of the same release; consult each `manifest.json`.
12
- The manifest lists **only uploaded shards whose remote size and SHA-256 have
13
- been verified**. An incomplete manifest is not a complete dataset.
14
-
15
- ## Scope and splits
16
-
17
- All 23 sources in the current SpatialEncoder training catalog are in scope.
18
- Original train/val/test labels are retained, including val-only HOPEImage.
19
- ScanNetpp is regenerated from all 856 official labeled training scenes and 50
20
- validation scenes, using all good DSLR frames (`frame_stride=1`). Official
21
- COLMAP poses, pinhole undistorted intrinsics and mesh-derived visible boxes are
22
- used. This is not the two-scene smoke catalog. The configured pinhole training
23
- source does not include iPhone or equirectangular panorama imagery. Unlabeled
24
- test scenes are not relabeled as training data. DSLR has no released dense
25
- depth target here; the native invalid-depth mask is preserved.
26
-
27
- ## Sample layout
28
-
29
- Each sample's entries are contiguous, with one shared basename:
30
-
31
- ```
32
- <key>.meta.json
33
- <key>.asset00000.jpg
34
- <key>.asset00001.npy
35
- ...
36
  ```
37
 
38
- JSON contains dataset, original split, camera intrinsics/poses, object
39
- annotations, native scale/depth conventions, source identity and asset
40
- bindings. Ordinary video blocks own 64 clip starts plus up to 14 lookahead
41
- frames, preserving every native 15-frame window across shard boundaries.
42
- Singleton-image sources use one frame per sample. Original image and depth
43
- encodings are retained byte-for-byte; random training augmentation is not
44
- frozen during export.
45
-
46
- Kubric stores the complete native TFRecord *record* containing a sequence,
47
- not an entire multi-record source shard. UCO3D stores a sequence MP4, HDF5
48
- depth, camera/box metadata and its filtered frame list; official excluded
49
- observations are retained as an explicit exclusion list. CA-1M stores native
50
- wide RGB/depth, shape records, official registered poses and JSON-converted
51
- annotations. Metadata never requires remote pickle execution.
52
 
53
- ## Streaming from HF or S3
 
 
 
 
54
 
55
- `reader.py` adapts raw WDS samples to the matching SpatialEncoder native
56
- training loader, preserving camera/depth corrections. Use it alongside the
57
- SpatialEncoder checkout and its dependencies (WebDataset, torch, OpenCV,
58
- Pillow, numpy, h5py, protobuf, etc.). Linux is required for its memory-backed
59
- seekable asset handles. HDF5 additionally needs one sequence-sized temporary
60
- file per active worker, deleted after decoding; set `SPATIAL_WDS_TMPDIR` to a
61
- local SSD or sufficiently large tmpfs. No original source directories or
62
- whole-shard downloads are needed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  ```python
65
- import webdataset as wds
66
- from reader import SpatialWDSDecoder
67
-
68
- # Replace with your uploaded S3 object(s); use an IAM role or standard AWS
69
- # credentials outside this code. This does not require a full local download.
70
- urls = ["pipe:aws s3 cp s3://YOUR_BUCKET/PREFIX/shard-000000.tar -"]
71
- raw = wds.WebDataset(
72
- urls, shardshuffle=False,
73
- nodesplitter=wds.split_by_node, workersplitter=wds.split_by_worker,
74
- )
75
- decoder = SpatialWDSDecoder(training=True)
76
- data = raw.map(decoder).select(lambda sample: sample is not None)
77
  ```
78
 
79
- For HTTPS, pass shard URLs from `urls/train.txt` (authenticated HTTP access
80
- is needed for private repos). HF shard URLs are pinned to their upload commit.
81
- The `pipe:` command must contain only trusted bucket/key strings.
82
-
83
- The default adapter samples one owned clip start per block visit. For an exact
84
- clip-coverage pass, flatten `decoder.iter_block(raw_sample)` instead. Dataset
85
- mixing weights, epochs, worker seeds and distributed batch sizing remain
86
- training configuration choices; equal source weighting must not be inferred
87
- from a concatenated shard list. Native filtering may return `None` for a clip
88
- with no usable objects, just as in the original loader.
89
 
90
- Each repo manifest includes logical source, split, byte count, sample count,
91
- SHA-256 and pinned URL per shard. `frames` includes temporal lookahead overlap;
92
- it must not be interpreted as a count of unique training frames.
 
 
93
 
94
- Source datasets retain their own licenses and access terms. This format does
95
- not grant additional redistribution rights or combine their licenses.
 
 
1
+ # SpatialEncoder frame WebDatasets
2
+
3
+ Each dataset has its own directory. ATEK's ten source packages share `ATEK/`.
4
+ The independent HOPEImage and HOPEVideo indexes have separate directories.
5
+
6
+ ```text
7
+ <dataset>/
8
+ manifest.json
9
+ shards/<split>/job-000001-00000.tar
10
+ scene_index/job-000001.jsonl.gz
11
+ metadata/job-000001.tar
12
+ source_info/<source-package>/support.tar
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ```
14
 
15
+ One WebDataset sample is one frame. All its members are contiguous in one TAR:
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ ```text
18
+ <key>.json
19
+ <key>.rgb.jpg # or rgb.png
20
+ <key>.depth.npy # or depth.png; absent for SceneVersepp
21
+ ```
22
 
23
+ TARs are uncompressed, with a target of 2 GiB. Samples are never split across
24
+ TARs. Assets retain their original bytes; there is no image recompression, depth
25
+ quantization, unit conversion, resizing, or missing-depth synthesis.
26
+
27
+ JSON contains dataset, scene_id, scene_key, frame_id, frame_index, num_frames,
28
+ split, output_split, indexed, source, scene_metadata, frame, objects, components.
29
+ `frame` is the original frame dictionary. `objects` contains objects annotated
30
+ in this frame, retaining their non-frame attributes and this frame's original
31
+ annotation dictionary. `scene_metadata` retains all original scene-level fields
32
+ except frames/objects. Full original scene JSON bytes are preserved in metadata
33
+ TARs, including objects without annotations in an individual frame.
34
+
35
+ Original rgb_path/depth_path values inside JSON are provenance, not local paths
36
+ to extract before training. Read the corresponding WDS fields using
37
+ `sample[meta['components']['rgb']]` and the optional depth component instead.
38
+
39
+ `scene_key = sha256(JSON([dataset, source_package, scene_json_relative_path]))[:32]`;
40
+ `key = sha256(JSON([scene_key, frame_id]))[:32]`, using compact UTF-8 JSON with
41
+ ensure_ascii=False. This avoids collisions across scenes, datasets and packages.
42
+ Frame order follows the original scene JSON insertion order. Each scene index
43
+ row lists every frame key and its shard, and locates the complete scene JSON.
44
+ A scene can span shards; use this index to construct multiframe training inputs.
45
+
46
+ Only original index entries appear in ordinary train/val splits. Additional
47
+ scene JSONs omitted from source indexes are preserved in `unindexed_train`,
48
+ `unindexed_test`, etc. They retain `indexed=false` and their directory-derived
49
+ source split. They are never silently promoted into the original training set.
50
+ Assets not referenced by any scene JSON remain in the unchanged raw_data source.
51
+ Source indexes, READMEs, manifests, licenses, configs, scripts, reports and QA
52
+ are preserved separately in support.tar, not mixed into frame sample streams.
53
+
54
+ Depth/geometry semantics remain dataset-specific: ATEK and Synscapes use metre
55
+ NPY depths; HOI4D, HOPE and SUN_RGB-D use millimetre PNG depths; ABO and ShapeNet
56
+ use normalized geometry. SceneVersepp has no dense depth. Do not interpret all
57
+ camera poses as valid temporal pose supervision; keep original supervision flags.
58
 
59
  ```python
60
+ from read_wds import dataset
61
+
62
+ for sample in dataset('raw_data_wds/ATEK', split='train'):
63
+ meta = sample['json']
64
+ rgb = sample[meta['components']['rgb']]
65
+ depth_field = meta['components']['depth']
66
+ depth = sample[depth_field] if depth_field else None
67
+ # meta['frame'], meta['objects'], meta['scene_metadata'] are annotations.
68
+ break
 
 
 
69
  ```
70
 
71
+ `decode=True` decodes JSON, RGB as PIL images, and depth as NumPy arrays. PNG
72
+ depth retains its original integer precision (it is never converted to RGB).
73
+ Use `decode=False` to receive original encoded bytes. The TAR payload is
74
+ unchanged regardless of decoding choice.
 
 
 
 
 
 
75
 
76
+ Every completed shard has its byte size, sample count and SHA-256 in manifest.
77
+ The converter reads back its first sample with the installed WebDataset library
78
+ and compares every component SHA-256 against source bytes before publication.
79
+ Original scene metadata and scene-to-shard indexes are also retained. A .partial
80
+ file is unfinished; only shards in a completed manifest should be consumed.
81
 
82
+ Restart the converter with the same output and options to resume completed jobs.
83
+ The conversion plan is immutable for an existing output. Completion receipts
84
+ are reused only if all associated output files still exist at their recorded size.