Move required evaluation dataset out of optional
Browse files- README.md +4 -3
- code/evaluation.patch +294 -204
- code/evaluation_manifest.json +4 -4
- {optional/evaluation → evaluation}/3dfront-00023.tar +0 -0
- {optional/evaluation → evaluation}/3dfront-00024.tar +0 -0
- {optional/evaluation → evaluation}/README.md +4 -2
- {optional/evaluation → evaluation}/index.json +4 -3
- {optional/evaluation → evaluation}/messykitchen-00001.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00002.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00003.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00004.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00005.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00006.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00007.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00008.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00009.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00010.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00011.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00012.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00013.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00014.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00015.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00016.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00017.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00018.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00019.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00020.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00021.tar +0 -0
- {optional/evaluation → evaluation}/messykitchen-00022.tar +0 -0
- {optional/evaluation → evaluation}/metadata.tar +1 -1
- {optional/evaluation → evaluation}/picasso-00000.tar +0 -0
- training/index.json +16 -12
README.md
CHANGED
|
@@ -145,10 +145,11 @@ The prepared data does not replace access agreements for original source assets.
|
|
| 145 |
[Posed object geometry](previews/3dfront/train-geometry.glb)
|
| 146 |
|
| 147 |
<!-- partprobe3d-frozen-evaluation:start -->
|
| 148 |
-
##
|
| 149 |
|
| 150 |
-
The
|
| 151 |
It includes all 100 PICASSO images, all 1,503 MessyKitchens images, and 1,000 random 3D-FRONT test views.
|
|
|
|
| 152 |
The transfer is 23.40 GB.
|
| 153 |
MessyKitchens shares 100 GT scene meshes across its views.
|
| 154 |
Default training downloads exclude this bundle.
|
|
@@ -156,6 +157,6 @@ Default training downloads exclude this bundle.
|
|
| 156 |
Apply the loader patch described in the bundle documentation before evaluating its samples.
|
| 157 |
|
| 158 |
```bash
|
| 159 |
-
python -m preprocess.huggingface download --repo cubec/PartProbe3D-preprocessed --
|
| 160 |
```
|
| 161 |
<!-- partprobe3d-frozen-evaluation:end -->
|
|
|
|
| 145 |
[Posed object geometry](previews/3dfront/train-geometry.glb)
|
| 146 |
|
| 147 |
<!-- partprobe3d-frozen-evaluation:start -->
|
| 148 |
+
## Required evaluation dataset
|
| 149 |
|
| 150 |
+
The required [evaluation dataset](evaluation/README.md) contains 2,603 images with visible masks and GT object meshes.
|
| 151 |
It includes all 100 PICASSO images, all 1,503 MessyKitchens images, and 1,000 random 3D-FRONT test views.
|
| 152 |
+
The PartProbe3D benchmark requires this dataset.
|
| 153 |
The transfer is 23.40 GB.
|
| 154 |
MessyKitchens shares 100 GT scene meshes across its views.
|
| 155 |
Default training downloads exclude this bundle.
|
|
|
|
| 157 |
Apply the loader patch described in the bundle documentation before evaluating its samples.
|
| 158 |
|
| 159 |
```bash
|
| 160 |
+
python -m preprocess.huggingface download --repo cubec/PartProbe3D-preprocessed --dataset evaluation
|
| 161 |
```
|
| 162 |
<!-- partprobe3d-frozen-evaluation:end -->
|
code/evaluation.patch
CHANGED
|
@@ -1,3 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
diff --git a/dataloader/registry.py b/dataloader/registry.py
|
| 2 |
index f3de37d..c9cba24 100644
|
| 3 |
--- a/dataloader/registry.py
|
|
@@ -93,6 +173,33 @@ index d61612c..8cb65e6 100644
|
|
| 93 |
write_prediction(folder / gt_name, sample.gt_meshes, coordinate_frame=sample.gt_coordinate_frame,
|
| 94 |
units="m", identity_mode=sample.metadata.get("input_mask_identity", "mask"),
|
| 95 |
method="ground-truth", provenance=provenance)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
diff --git a/evaluation/evaluate.py b/evaluation/evaluate.py
|
| 97 |
index e50d3ea..318de5c 100644
|
| 98 |
--- a/evaluation/evaluate.py
|
|
@@ -231,181 +338,9 @@ index 3968d22..5f985e0 100644
|
|
| 231 |
def collect_runs(run, selection):
|
| 232 |
"""Collect recorded model outputs and disjoint shards by their method metadata."""
|
| 233 |
expected = {frame["key"]: frame for frame in selection["frames"]}
|
| 234 |
-
diff --git a/preprocess/huggingface.py b/preprocess/huggingface.py
|
| 235 |
-
index 2fdce63..df8bdf1 100644
|
| 236 |
-
--- a/preprocess/huggingface.py
|
| 237 |
-
+++ b/preprocess/huggingface.py
|
| 238 |
-
@@ -394,9 +394,9 @@ def extract(index, folder, destination):
|
| 239 |
-
if index.get('schema') != SCHEMA or not index.get('complete'):
|
| 240 |
-
raise ValueError('A complete archive index is required')
|
| 241 |
-
folder, destination = Path(folder), Path(destination).resolve()
|
| 242 |
-
- prefix = _relative(index['destination'])
|
| 243 |
-
+ prefix = _relative(index.get('archive_prefix', index['destination']))
|
| 244 |
-
restored_prefix = (_slat_destination(index['name'], index['resolution'])
|
| 245 |
-
- if index.get('artifact_kind') == 'slat-shape-targets' else prefix)
|
| 246 |
-
+ if index.get('artifact_kind') == 'slat-shape-targets' else _relative(index['destination']))
|
| 247 |
-
# Publish the original complete manifest only after restoring its artifacts.
|
| 248 |
-
for item in sorted(index['archives'], key=lambda item: item['file'] == 'metadata.tar'):
|
| 249 |
-
path = folder / _relative(item['file'])
|
| 250 |
-
@@ -563,7 +563,7 @@ def download(repo, name, destination, revision, *, cleanup=None, bundle_root=Non
|
| 251 |
-
# Keep active training folders free of transfer archives. Retain the legacy
|
| 252 |
-
# cache path only when an explicit historical component needs resume.
|
| 253 |
-
cache = (destination / 'datasets' / '_deprecated' / name / 'huggingface'
|
| 254 |
-
- if bundle_root.startswith(('training/', 'optional/'))
|
| 255 |
-
+ if bundle_root.split('/')[0] in ('training', 'optional')
|
| 256 |
-
else destination / 'datasets' / name / 'archives' / 'huggingface')
|
| 257 |
-
index_path = hf_hub_download(repo, f'{bundle_root}/{name}/index.json', repo_type='dataset',
|
| 258 |
-
revision=revision, local_dir=cache)
|
| 259 |
-
@@ -894,6 +894,8 @@ def main():
|
| 260 |
-
if args.optional and args.bundle_root:
|
| 261 |
-
parser.error('--optional and --bundle-root cannot be combined')
|
| 262 |
-
bundle_root = f'optional/{args.optional.replace("-", "_")}' if args.optional else args.bundle_root
|
| 263 |
-
+ if args.optional == 'evaluation' and args.dataset == 'all':
|
| 264 |
-
+ args.dataset, bundle_root = 'evaluation', 'optional'
|
| 265 |
-
if args.optional and args.dataset == 'all':
|
| 266 |
-
parser.error('Select one dataset with --dataset for an optional download')
|
| 267 |
-
cleanup = not args.keep_archives if bundle_root is None or args.optional else args.cleanup
|
| 268 |
-
diff --git a/preprocess/reproduction.py b/preprocess/reproduction.py
|
| 269 |
-
index fd0ccd7..deabce5 100644
|
| 270 |
-
--- a/preprocess/reproduction.py
|
| 271 |
-
+++ b/preprocess/reproduction.py
|
| 272 |
-
@@ -180,6 +180,8 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 273 |
-
raise ValueError(f'Package source changed. Select another output: {component}/{name}')
|
| 274 |
-
previous = {row['file']: row for row in old.get('archives', [])}
|
| 275 |
-
index = {'schema': SCHEMA, 'name': name, 'complete': False, **identity, 'archives': []}
|
| 276 |
-
+ if 'archive_prefix' in old:
|
| 277 |
-
+ index['archive_prefix'] = old['archive_prefix']
|
| 278 |
-
atomic_json(path, index)
|
| 279 |
-
|
| 280 |
-
def save(label, files, views):
|
| 281 |
-
@@ -197,7 +199,8 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 282 |
-
if reusable:
|
| 283 |
-
record = old_record
|
| 284 |
-
else:
|
| 285 |
-
- record = _archive(folder / filename, files, root, Path(destination), old_record, checksums=checksums)
|
| 286 |
-
+ record = _archive(folder / filename, files, root,
|
| 287 |
-
+ Path(index.get('archive_prefix', destination)), old_record, checksums=checksums)
|
| 288 |
-
record['views'] = views
|
| 289 |
-
index['archives'].append(record)
|
| 290 |
-
atomic_json(path, index)
|
| 291 |
-
@@ -440,14 +443,15 @@ def _copy_files(api, repo, output, mapping, *, revision=LEGACY_REVISION, remove_
|
| 292 |
-
return commits
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
-def export_code(output, base_revision):
|
| 296 |
-
- """Export only this migration's source changes, preserving unrelated workspace edits."""
|
| 297 |
-
+def export_code(output, base_revision, *, tracked=None, added=None, name='reproduction'):
|
| 298 |
-
+ """Export selected source changes and preserve unrelated workspace edits."""
|
| 299 |
-
output = Path(output)
|
| 300 |
-
folder = output / 'code'
|
| 301 |
-
folder.mkdir(parents=True, exist_ok=True)
|
| 302 |
-
- tracked = ['HF_DATASETS.md', 'preprocess/slat/HUGGING_FACE.md', 'preprocess/slat/README.md', 'dataloader/dataset.py',
|
| 303 |
-
- 'dataloader/extent.py', 'preprocess/huggingface.py', 'preprocess/validate_dataset.py']
|
| 304 |
-
- added = ['preprocess/reproduction.py', 'preprocess/tests/test_reproduction.py']
|
| 305 |
-
+ tracked = (['HF_DATASETS.md', 'preprocess/slat/HUGGING_FACE.md', 'preprocess/slat/README.md', 'dataloader/dataset.py',
|
| 306 |
-
+ 'dataloader/extent.py', 'preprocess/huggingface.py', 'preprocess/validate_dataset.py']
|
| 307 |
-
+ if tracked is None else tracked)
|
| 308 |
-
+ added = ['preprocess/reproduction.py', 'preprocess/tests/test_reproduction.py'] if added is None else added
|
| 309 |
-
content = subprocess.check_output(['git', 'diff', '--binary', base_revision, '--', *tracked, *added])
|
| 310 |
-
for path in added:
|
| 311 |
-
present = subprocess.run(['git', 'cat-file', '-e', f'{base_revision}:{path}'],
|
| 312 |
-
@@ -461,11 +465,11 @@ def export_code(output, base_revision):
|
| 313 |
-
if result.returncode not in (0, 1):
|
| 314 |
-
raise RuntimeError(f'Cannot export restore source: {path}')
|
| 315 |
-
content += result.stdout
|
| 316 |
-
- patch = folder / 'reproduction.patch'
|
| 317 |
-
+ patch = folder / f'{name}.patch'
|
| 318 |
-
patch.write_bytes(content)
|
| 319 |
-
manifest = {'base_git_revision': base_revision, 'patch_sha256': sha256(patch),
|
| 320 |
-
'files': {path: sha256(path) for path in [*tracked, *added]}}
|
| 321 |
-
- atomic_json(folder / 'manifest.json', manifest)
|
| 322 |
-
+ atomic_json(folder / ('manifest.json' if name == 'reproduction' else f'{name}_manifest.json'), manifest)
|
| 323 |
-
return manifest
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
diff --git a/dataloader/frozen.py b/dataloader/frozen.py
|
| 327 |
-
new file mode 100644
|
| 328 |
-
index 0000000..2a43518
|
| 329 |
-
--- /dev/null
|
| 330 |
-
+++ b/dataloader/frozen.py
|
| 331 |
-
@@ -0,0 +1,74 @@
|
| 332 |
-
+"""Read portable RGB, masks, and shared GT meshes from frozen evaluation data."""
|
| 333 |
-
+from collections import defaultdict
|
| 334 |
-
+import json
|
| 335 |
-
+
|
| 336 |
-
+import numpy as np
|
| 337 |
-
+from PIL import Image
|
| 338 |
-
+import trimesh
|
| 339 |
-
+
|
| 340 |
-
+from .base import BaseDataLoader, EvaluationSample
|
| 341 |
-
+from .geometry import artifact_path, checked_digest
|
| 342 |
-
+from utils.hashing import input_hashes, sha256
|
| 343 |
-
+
|
| 344 |
-
+
|
| 345 |
-
+SCHEMA = 'partprobe3d.frozen-evaluation.v1'
|
| 346 |
-
+
|
| 347 |
-
+
|
| 348 |
-
+class FrozenEvaluationLoader(BaseDataLoader):
|
| 349 |
-
+ """Load saved evaluation inputs without the original source datasets."""
|
| 350 |
-
+ name = 'frozen'
|
| 351 |
-
+
|
| 352 |
-
+ def __init__(self, root):
|
| 353 |
-
+ super().__init__(root)
|
| 354 |
-
+ self.manifest_path = self.root / 'manifest.json'
|
| 355 |
-
+ self.manifest = json.loads(self.manifest_path.read_text())
|
| 356 |
-
+ if self.manifest.get('schema') != SCHEMA or not self.manifest.get('complete'):
|
| 357 |
-
+ raise ValueError('A complete frozen evaluation dataset is required')
|
| 358 |
-
+ self.rows = self.manifest['frames']
|
| 359 |
-
+ if not self.rows or len({row['key'] for row in self.rows}) != len(self.rows):
|
| 360 |
-
+ raise ValueError('Frozen evaluation sample keys must be nonempty and unique')
|
| 361 |
-
+
|
| 362 |
-
+ def __len__(self):
|
| 363 |
-
+ return len(self.rows)
|
| 364 |
-
+
|
| 365 |
-
+ def _load_sample(self, index):
|
| 366 |
-
+ row = self.rows[index]
|
| 367 |
-
+ paths = {key: artifact_path(self.root, row[key]) for key in ('rgb', 'masks', 'ground_truth')}
|
| 368 |
-
+ for relative in (row[key] for key in paths):
|
| 369 |
-
+ if checked_digest(artifact_path(self.root, relative)) != self.manifest['files'][relative]:
|
| 370 |
-
+ raise ValueError(f'Frozen evaluation file checksum differs: {relative}')
|
| 371 |
-
+ with Image.open(paths['rgb']) as image:
|
| 372 |
-
+ rgb = np.array(image.convert('RGB'))
|
| 373 |
-
+ with Image.open(paths['masks']) as image:
|
| 374 |
-
+ masks = np.array(image).astype(np.int32)
|
| 375 |
-
+ if input_hashes(rgb, masks) != {key: row[key] for key in ('rgb_sha256', 'masks_sha256')}:
|
| 376 |
-
+ raise ValueError('Frozen RGB pixels or mask labels differ from the source selection')
|
| 377 |
-
+ scene = trimesh.load(paths['ground_truth'], force='scene', process=False)
|
| 378 |
-
+ metadata = scene.metadata.get('partprobe3d', {})
|
| 379 |
-
+ if (metadata.get('schema') != 'partprobe3d.object-meshes.v1' or metadata.get('units') != 'm'
|
| 380 |
-
+ or metadata.get('coordinate_frame') != row['gt_coordinate_frame']
|
| 381 |
-
+ or metadata.get('identity_mode') != row['dataset_metadata'].get('input_mask_identity', 'mask')):
|
| 382 |
-
+ raise ValueError('Frozen GT mesh metadata differs from the selection')
|
| 383 |
-
+ pieces = defaultdict(list)
|
| 384 |
-
+ for node in scene.graph.nodes_geometry:
|
| 385 |
-
+ transform, geometry = scene.graph[node]
|
| 386 |
-
+ mesh = scene.geometry[geometry].copy().apply_transform(transform)
|
| 387 |
-
+ pieces[int(mesh.metadata['object_index'])].append(mesh)
|
| 388 |
-
+ meshes = {index: trimesh.util.concatenate(parts) for index, parts in pieces.items()}
|
| 389 |
-
+ if (set(meshes) != {int(obj['object_index']) for obj in metadata['objects']}
|
| 390 |
-
+ or len(meshes) != row['target_objects']):
|
| 391 |
-
+ raise ValueError('Frozen GT objects differ from the selection')
|
| 392 |
-
+ return EvaluationSample(key=row['key'], rgb=rgb, masks=masks, gt_meshes=meshes,
|
| 393 |
-
+ gt_coordinate_frame=row['gt_coordinate_frame'], metadata=row['dataset_metadata'],
|
| 394 |
-
+ visibility=row.get('visibility', {}), mask_overlap_pixels=row.get('mask_overlap_pixels', 0),
|
| 395 |
-
+ discarded_mask_pixels=row.get('discarded_mask_pixels', {}))
|
| 396 |
-
+
|
| 397 |
-
+ def sample_records(self):
|
| 398 |
-
+ return [{'index': i, 'key': row['key'], 'group': row['dataset_metadata'].get('scene', row['key']),
|
| 399 |
-
+ 'order': row['dataset_metadata'].get('source_view', row['key'])}
|
| 400 |
-
+ for i, row in enumerate(self.rows)]
|
| 401 |
-
+
|
| 402 |
-
+ def provenance(self):
|
| 403 |
-
+ return {**super().provenance(), 'manifest_sha256': sha256(self.manifest_path),
|
| 404 |
-
+ 'source_selection_sha256': self.manifest['source_selection_sha256'],
|
| 405 |
-
+ 'source_dataset': self.manifest['source_dataset'], 'gt_representation': 'exported GLB float32'}
|
| 406 |
diff --git a/preprocess/evaluation.py b/preprocess/evaluation.py
|
| 407 |
new file mode 100644
|
| 408 |
-
index 0000000..
|
| 409 |
--- /dev/null
|
| 410 |
+++ b/preprocess/evaluation.py
|
| 411 |
@@ -0,0 +1,171 @@
|
|
@@ -518,7 +453,7 @@ index 0000000..abe6e3b
|
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+def publish(source, output, repo=DEFAULT_REPO, *, workers=4, shard_bytes=1024**3):
|
| 521 |
-
+ """Publish
|
| 522 |
+ source, output = Path(source).resolve(), Path(output).resolve()
|
| 523 |
+ cohort = json.loads((source / 'index.json').read_text())
|
| 524 |
+ if not cohort.get('complete'):
|
|
@@ -526,7 +461,7 @@ index 0000000..abe6e3b
|
|
| 526 |
+ output.mkdir(parents=True, exist_ok=True)
|
| 527 |
+ publisher = Publisher(repo, workers=workers)
|
| 528 |
+ result = {'repo': repo, 'complete': False, 'total_views': cohort['total_views'],
|
| 529 |
-
+ 'component': '
|
| 530 |
+ atomic_json(output / 'status.json', result)
|
| 531 |
+ metadata = [source / 'index.json', *sorted(source.glob('*.md'))]
|
| 532 |
+ groups, checksums = [], {}
|
|
@@ -545,11 +480,11 @@ index 0000000..abe6e3b
|
|
| 545 |
+ metadata.extend([root / 'manifest.json', root / 'source_selection.json', *sorted(root.glob('*.md'))])
|
| 546 |
+ groups.extend((name, sorted(paths), counts[scene]) for scene, paths in sorted(scenes.items()))
|
| 547 |
+ checksums.update({artifact_path(root, key): value for key, value in manifest['files'].items()})
|
| 548 |
-
+ index = package(source, output, '
|
| 549 |
+ destination=Path('datasets/evaluation'), kind='frozen-evaluation',
|
| 550 |
+ metadata=metadata, groups=groups, checksums=checksums,
|
| 551 |
+ details={'source_manifest_sha256': sha256(source / 'index.json'), 'views': cohort['total_views'],
|
| 552 |
-
+ 'datasets': cohort['datasets'], 'evaluation_only': True},
|
| 553 |
+ shard_bytes=shard_bytes, publisher=publisher)
|
| 554 |
+ result.update(complete=True, bytes=index['bytes'], archives=len(index['archives']),
|
| 555 |
+ revision=publisher.api.dataset_info(repo).sha)
|
|
@@ -580,30 +515,185 @@ index 0000000..abe6e3b
|
|
| 580 |
+
|
| 581 |
+if __name__ == '__main__':
|
| 582 |
+ main()
|
| 583 |
-
diff --git a/
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
+
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
--
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
+
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
+
|
| 609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/dataloader/frozen.py b/dataloader/frozen.py
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 0000000..2a43518
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/dataloader/frozen.py
|
| 6 |
+
@@ -0,0 +1,74 @@
|
| 7 |
+
+"""Read portable RGB, masks, and shared GT meshes from frozen evaluation data."""
|
| 8 |
+
+from collections import defaultdict
|
| 9 |
+
+import json
|
| 10 |
+
+
|
| 11 |
+
+import numpy as np
|
| 12 |
+
+from PIL import Image
|
| 13 |
+
+import trimesh
|
| 14 |
+
+
|
| 15 |
+
+from .base import BaseDataLoader, EvaluationSample
|
| 16 |
+
+from .geometry import artifact_path, checked_digest
|
| 17 |
+
+from utils.hashing import input_hashes, sha256
|
| 18 |
+
+
|
| 19 |
+
+
|
| 20 |
+
+SCHEMA = 'partprobe3d.frozen-evaluation.v1'
|
| 21 |
+
+
|
| 22 |
+
+
|
| 23 |
+
+class FrozenEvaluationLoader(BaseDataLoader):
|
| 24 |
+
+ """Load saved evaluation inputs without the original source datasets."""
|
| 25 |
+
+ name = 'frozen'
|
| 26 |
+
+
|
| 27 |
+
+ def __init__(self, root):
|
| 28 |
+
+ super().__init__(root)
|
| 29 |
+
+ self.manifest_path = self.root / 'manifest.json'
|
| 30 |
+
+ self.manifest = json.loads(self.manifest_path.read_text())
|
| 31 |
+
+ if self.manifest.get('schema') != SCHEMA or not self.manifest.get('complete'):
|
| 32 |
+
+ raise ValueError('A complete frozen evaluation dataset is required')
|
| 33 |
+
+ self.rows = self.manifest['frames']
|
| 34 |
+
+ if not self.rows or len({row['key'] for row in self.rows}) != len(self.rows):
|
| 35 |
+
+ raise ValueError('Frozen evaluation sample keys must be nonempty and unique')
|
| 36 |
+
+
|
| 37 |
+
+ def __len__(self):
|
| 38 |
+
+ return len(self.rows)
|
| 39 |
+
+
|
| 40 |
+
+ def _load_sample(self, index):
|
| 41 |
+
+ row = self.rows[index]
|
| 42 |
+
+ paths = {key: artifact_path(self.root, row[key]) for key in ('rgb', 'masks', 'ground_truth')}
|
| 43 |
+
+ for relative in (row[key] for key in paths):
|
| 44 |
+
+ if checked_digest(artifact_path(self.root, relative)) != self.manifest['files'][relative]:
|
| 45 |
+
+ raise ValueError(f'Frozen evaluation file checksum differs: {relative}')
|
| 46 |
+
+ with Image.open(paths['rgb']) as image:
|
| 47 |
+
+ rgb = np.array(image.convert('RGB'))
|
| 48 |
+
+ with Image.open(paths['masks']) as image:
|
| 49 |
+
+ masks = np.array(image).astype(np.int32)
|
| 50 |
+
+ if input_hashes(rgb, masks) != {key: row[key] for key in ('rgb_sha256', 'masks_sha256')}:
|
| 51 |
+
+ raise ValueError('Frozen RGB pixels or mask labels differ from the source selection')
|
| 52 |
+
+ scene = trimesh.load(paths['ground_truth'], force='scene', process=False)
|
| 53 |
+
+ metadata = scene.metadata.get('partprobe3d', {})
|
| 54 |
+
+ if (metadata.get('schema') != 'partprobe3d.object-meshes.v1' or metadata.get('units') != 'm'
|
| 55 |
+
+ or metadata.get('coordinate_frame') != row['gt_coordinate_frame']
|
| 56 |
+
+ or metadata.get('identity_mode') != row['dataset_metadata'].get('input_mask_identity', 'mask')):
|
| 57 |
+
+ raise ValueError('Frozen GT mesh metadata differs from the selection')
|
| 58 |
+
+ pieces = defaultdict(list)
|
| 59 |
+
+ for node in scene.graph.nodes_geometry:
|
| 60 |
+
+ transform, geometry = scene.graph[node]
|
| 61 |
+
+ mesh = scene.geometry[geometry].copy().apply_transform(transform)
|
| 62 |
+
+ pieces[int(mesh.metadata['object_index'])].append(mesh)
|
| 63 |
+
+ meshes = {index: trimesh.util.concatenate(parts) for index, parts in pieces.items()}
|
| 64 |
+
+ if (set(meshes) != {int(obj['object_index']) for obj in metadata['objects']}
|
| 65 |
+
+ or len(meshes) != row['target_objects']):
|
| 66 |
+
+ raise ValueError('Frozen GT objects differ from the selection')
|
| 67 |
+
+ return EvaluationSample(key=row['key'], rgb=rgb, masks=masks, gt_meshes=meshes,
|
| 68 |
+
+ gt_coordinate_frame=row['gt_coordinate_frame'], metadata=row['dataset_metadata'],
|
| 69 |
+
+ visibility=row.get('visibility', {}), mask_overlap_pixels=row.get('mask_overlap_pixels', 0),
|
| 70 |
+
+ discarded_mask_pixels=row.get('discarded_mask_pixels', {}))
|
| 71 |
+
+
|
| 72 |
+
+ def sample_records(self):
|
| 73 |
+
+ return [{'index': i, 'key': row['key'], 'group': row['dataset_metadata'].get('scene', row['key']),
|
| 74 |
+
+ 'order': row['dataset_metadata'].get('source_view', row['key'])}
|
| 75 |
+
+ for i, row in enumerate(self.rows)]
|
| 76 |
+
+
|
| 77 |
+
+ def provenance(self):
|
| 78 |
+
+ return {**super().provenance(), 'manifest_sha256': sha256(self.manifest_path),
|
| 79 |
+
+ 'source_selection_sha256': self.manifest['source_selection_sha256'],
|
| 80 |
+
+ 'source_dataset': self.manifest['source_dataset'], 'gt_representation': 'exported GLB float32'}
|
| 81 |
diff --git a/dataloader/registry.py b/dataloader/registry.py
|
| 82 |
index f3de37d..c9cba24 100644
|
| 83 |
--- a/dataloader/registry.py
|
|
|
|
| 173 |
write_prediction(folder / gt_name, sample.gt_meshes, coordinate_frame=sample.gt_coordinate_frame,
|
| 174 |
units="m", identity_mode=sample.metadata.get("input_mask_identity", "mask"),
|
| 175 |
method="ground-truth", provenance=provenance)
|
| 176 |
+
diff --git a/evaluation/configs/front3d_frozen.json b/evaluation/configs/front3d_frozen.json
|
| 177 |
+
new file mode 100644
|
| 178 |
+
index 0000000..c84bba7
|
| 179 |
+
--- /dev/null
|
| 180 |
+
+++ b/evaluation/configs/front3d_frozen.json
|
| 181 |
+
@@ -0,0 +1,3 @@
|
| 182 |
+
+{
|
| 183 |
+
+ "root": "datasets/evaluation/3dfront"
|
| 184 |
+
+}
|
| 185 |
+
diff --git a/evaluation/configs/messykitchen_frozen.json b/evaluation/configs/messykitchen_frozen.json
|
| 186 |
+
new file mode 100644
|
| 187 |
+
index 0000000..2bf4e4b
|
| 188 |
+
--- /dev/null
|
| 189 |
+
+++ b/evaluation/configs/messykitchen_frozen.json
|
| 190 |
+
@@ -0,0 +1,3 @@
|
| 191 |
+
+{
|
| 192 |
+
+ "root": "datasets/evaluation/messykitchen"
|
| 193 |
+
+}
|
| 194 |
+
diff --git a/evaluation/configs/picasso_frozen.json b/evaluation/configs/picasso_frozen.json
|
| 195 |
+
new file mode 100644
|
| 196 |
+
index 0000000..7d85ea9
|
| 197 |
+
--- /dev/null
|
| 198 |
+
+++ b/evaluation/configs/picasso_frozen.json
|
| 199 |
+
@@ -0,0 +1,3 @@
|
| 200 |
+
+{
|
| 201 |
+
+ "root": "datasets/evaluation/picasso"
|
| 202 |
+
+}
|
| 203 |
diff --git a/evaluation/evaluate.py b/evaluation/evaluate.py
|
| 204 |
index e50d3ea..318de5c 100644
|
| 205 |
--- a/evaluation/evaluate.py
|
|
|
|
| 338 |
def collect_runs(run, selection):
|
| 339 |
"""Collect recorded model outputs and disjoint shards by their method metadata."""
|
| 340 |
expected = {frame["key"]: frame for frame in selection["frames"]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
diff --git a/preprocess/evaluation.py b/preprocess/evaluation.py
|
| 342 |
new file mode 100644
|
| 343 |
+
index 0000000..f920ac4
|
| 344 |
--- /dev/null
|
| 345 |
+++ b/preprocess/evaluation.py
|
| 346 |
@@ -0,0 +1,171 @@
|
|
|
|
| 453 |
+
|
| 454 |
+
|
| 455 |
+def publish(source, output, repo=DEFAULT_REPO, *, workers=4, shard_bytes=1024**3):
|
| 456 |
+
+ """Publish the required evaluation archives through the verified project uploader."""
|
| 457 |
+ source, output = Path(source).resolve(), Path(output).resolve()
|
| 458 |
+ cohort = json.loads((source / 'index.json').read_text())
|
| 459 |
+ if not cohort.get('complete'):
|
|
|
|
| 461 |
+ output.mkdir(parents=True, exist_ok=True)
|
| 462 |
+ publisher = Publisher(repo, workers=workers)
|
| 463 |
+ result = {'repo': repo, 'complete': False, 'total_views': cohort['total_views'],
|
| 464 |
+
+ 'component': 'evaluation', 'datasets': cohort['datasets']}
|
| 465 |
+ atomic_json(output / 'status.json', result)
|
| 466 |
+ metadata = [source / 'index.json', *sorted(source.glob('*.md'))]
|
| 467 |
+ groups, checksums = [], {}
|
|
|
|
| 480 |
+ metadata.extend([root / 'manifest.json', root / 'source_selection.json', *sorted(root.glob('*.md'))])
|
| 481 |
+ groups.extend((name, sorted(paths), counts[scene]) for scene, paths in sorted(scenes.items()))
|
| 482 |
+ checksums.update({artifact_path(root, key): value for key, value in manifest['files'].items()})
|
| 483 |
+
+ index = package(source, output, '', 'evaluation',
|
| 484 |
+ destination=Path('datasets/evaluation'), kind='frozen-evaluation',
|
| 485 |
+ metadata=metadata, groups=groups, checksums=checksums,
|
| 486 |
+ details={'source_manifest_sha256': sha256(source / 'index.json'), 'views': cohort['total_views'],
|
| 487 |
+
+ 'datasets': cohort['datasets'], 'evaluation_only': True, 'required_for_evaluation': True},
|
| 488 |
+ shard_bytes=shard_bytes, publisher=publisher)
|
| 489 |
+ result.update(complete=True, bytes=index['bytes'], archives=len(index['archives']),
|
| 490 |
+ revision=publisher.api.dataset_info(repo).sha)
|
|
|
|
| 515 |
+
|
| 516 |
+if __name__ == '__main__':
|
| 517 |
+ main()
|
| 518 |
+
diff --git a/preprocess/huggingface.py b/preprocess/huggingface.py
|
| 519 |
+
index 2fdce63..9062d24 100644
|
| 520 |
+
--- a/preprocess/huggingface.py
|
| 521 |
+
+++ b/preprocess/huggingface.py
|
| 522 |
+
@@ -394,9 +394,9 @@ def extract(index, folder, destination):
|
| 523 |
+
if index.get('schema') != SCHEMA or not index.get('complete'):
|
| 524 |
+
raise ValueError('A complete archive index is required')
|
| 525 |
+
folder, destination = Path(folder), Path(destination).resolve()
|
| 526 |
+
- prefix = _relative(index['destination'])
|
| 527 |
+
+ prefix = _relative(index.get('archive_prefix', index['destination']))
|
| 528 |
+
restored_prefix = (_slat_destination(index['name'], index['resolution'])
|
| 529 |
+
- if index.get('artifact_kind') == 'slat-shape-targets' else prefix)
|
| 530 |
+
+ if index.get('artifact_kind') == 'slat-shape-targets' else _relative(index['destination']))
|
| 531 |
+
# Publish the original complete manifest only after restoring its artifacts.
|
| 532 |
+
for item in sorted(index['archives'], key=lambda item: item['file'] == 'metadata.tar'):
|
| 533 |
+
path = folder / _relative(item['file'])
|
| 534 |
+
@@ -551,6 +551,8 @@ def upload(output, repo, names, *, follow=False, packing=None, update_card=False
|
| 535 |
+
|
| 536 |
+
|
| 537 |
+
def download(repo, name, destination, revision, *, cleanup=None, bundle_root=None):
|
| 538 |
+
+ if name == 'evaluation' and bundle_root is None:
|
| 539 |
+
+ bundle_root = ''
|
| 540 |
+
if bundle_root is None:
|
| 541 |
+
from preprocess.reproduction import download_training
|
| 542 |
+
return download_training(repo, name, destination, revision, cleanup=cleanup is not False)
|
| 543 |
+
@@ -558,19 +560,20 @@ def download(repo, name, destination, revision, *, cleanup=None, bundle_root=Non
|
| 544 |
+
from utils.huggingface_download import download_huggingface_file
|
| 545 |
+
# Resolve main once so all archives and the index belong to one snapshot.
|
| 546 |
+
revision = HfApi().dataset_info(repo, revision=revision).sha
|
| 547 |
+
- bundle_root = str(_relative(bundle_root))
|
| 548 |
+
+ bundle_root = str(_relative(bundle_root)) if bundle_root else ''
|
| 549 |
+
+ component = str(PurePosixPath(bundle_root) / _relative(name))
|
| 550 |
+
destination = Path(destination).resolve()
|
| 551 |
+
- # Keep active training folders free of transfer archives. Retain the legacy
|
| 552 |
+
+ # Keep active dataset folders free of transfer archives. Retain the legacy
|
| 553 |
+
# cache path only when an explicit historical component needs resume.
|
| 554 |
+
cache = (destination / 'datasets' / '_deprecated' / name / 'huggingface'
|
| 555 |
+
- if bundle_root.startswith(('training/', 'optional/'))
|
| 556 |
+
+ if component.split('/')[0] in ('training', 'optional', 'evaluation')
|
| 557 |
+
else destination / 'datasets' / name / 'archives' / 'huggingface')
|
| 558 |
+
- index_path = hf_hub_download(repo, f'{bundle_root}/{name}/index.json', repo_type='dataset',
|
| 559 |
+
+ index_path = hf_hub_download(repo, f'{component}/index.json', repo_type='dataset',
|
| 560 |
+
revision=revision, local_dir=cache)
|
| 561 |
+
index = _json(index_path)
|
| 562 |
+
if index.get('name') != name or not index.get('complete'):
|
| 563 |
+
raise ValueError('Requested dataset has no complete archive index')
|
| 564 |
+
- folder = cache / bundle_root / name
|
| 565 |
+
+ folder = cache / component
|
| 566 |
+
status_path = folder / 'download-status.json'
|
| 567 |
+
status = {'state': 'running', 'pid': os.getpid(), 'repo': repo, 'revision': revision,
|
| 568 |
+
'dataset': name, 'bundle_root': bundle_root, 'started_unix': time.time(),
|
| 569 |
+
@@ -592,7 +595,7 @@ def download(repo, name, destination, revision, *, cleanup=None, bundle_root=Non
|
| 570 |
+
status.update(state='downloading', current_archive=item['file'], active_transfer=None)
|
| 571 |
+
save()
|
| 572 |
+
archive = download_huggingface_file(
|
| 573 |
+
- repo, f'{bundle_root}/{name}/{item["file"]}', repo_type='dataset',
|
| 574 |
+
+ repo, f'{component}/{item["file"]}', repo_type='dataset',
|
| 575 |
+
revision=revision, local_dir=cache, expected_size=item['bytes'],
|
| 576 |
+
expected_sha256=item['sha256'], progress=progress)
|
| 577 |
+
status['state'] = 'restoring'
|
| 578 |
+
@@ -854,7 +857,7 @@ def main():
|
| 579 |
+
help='Concurrent archive transfers. Default: Hugging Face client setting')
|
| 580 |
+
restoring = commands.add_parser('download')
|
| 581 |
+
restoring.add_argument('--repo', required=True)
|
| 582 |
+
- restoring.add_argument('--dataset', default='all', help='Dataset name. Default: 3D-FRONT and SAGE')
|
| 583 |
+
+ restoring.add_argument('--dataset', default='all', help='Training dataset name, or evaluation for the required benchmark')
|
| 584 |
+
restoring.add_argument('--destination', type=Path, default=Path('.'))
|
| 585 |
+
restoring.add_argument('--revision', default='main')
|
| 586 |
+
restoring.add_argument('--bundle-root', default=None,
|
| 587 |
+
diff --git a/preprocess/reproduction.py b/preprocess/reproduction.py
|
| 588 |
+
index fd0ccd7..0e7d210 100644
|
| 589 |
+
--- a/preprocess/reproduction.py
|
| 590 |
+
+++ b/preprocess/reproduction.py
|
| 591 |
+
@@ -171,8 +171,9 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 592 |
+
details=None, checksums=None, shard_bytes=1024**3, publisher=None):
|
| 593 |
+
"""Write deterministic shards and publish them with bounded temporary storage."""
|
| 594 |
+
root, output = Path(root).resolve(), Path(output).resolve()
|
| 595 |
+
- folder = output / _relative(component) / name
|
| 596 |
+
+ folder = output / (_relative(component) if component else Path()) / name
|
| 597 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 598 |
+
+ remote_root = str(folder.relative_to(output))
|
| 599 |
+
path = folder / 'index.json'
|
| 600 |
+
old = _json(path) if path.exists() else {}
|
| 601 |
+
identity = {'destination': str(destination), 'artifact_kind': kind, **(details or {})}
|
| 602 |
+
@@ -180,13 +181,15 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 603 |
+
raise ValueError(f'Package source changed. Select another output: {component}/{name}')
|
| 604 |
+
previous = {row['file']: row for row in old.get('archives', [])}
|
| 605 |
+
index = {'schema': SCHEMA, 'name': name, 'complete': False, **identity, 'archives': []}
|
| 606 |
+
+ if 'archive_prefix' in old:
|
| 607 |
+
+ index['archive_prefix'] = old['archive_prefix']
|
| 608 |
+
atomic_json(path, index)
|
| 609 |
+
|
| 610 |
+
def save(label, files, views):
|
| 611 |
+
filename = label + '.tar'
|
| 612 |
+
files = sorted(set(files))
|
| 613 |
+
old_record = previous.get(filename)
|
| 614 |
+
- remote_path = f'{component}/{name}/{filename}'
|
| 615 |
+
+ remote_path = f'{remote_root}/{filename}'
|
| 616 |
+
reusable = False
|
| 617 |
+
if old_record and publisher and publisher.matches(remote_path, old_record):
|
| 618 |
+
records = []
|
| 619 |
+
@@ -197,7 +200,8 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 620 |
+
if reusable:
|
| 621 |
+
record = old_record
|
| 622 |
+
else:
|
| 623 |
+
- record = _archive(folder / filename, files, root, Path(destination), old_record, checksums=checksums)
|
| 624 |
+
+ record = _archive(folder / filename, files, root,
|
| 625 |
+
+ Path(index.get('archive_prefix', destination)), old_record, checksums=checksums)
|
| 626 |
+
record['views'] = views
|
| 627 |
+
index['archives'].append(record)
|
| 628 |
+
atomic_json(path, index)
|
| 629 |
+
@@ -226,7 +230,7 @@ def package(root, output, component, name, *, destination, kind, metadata, group
|
| 630 |
+
index.update(complete=True, bytes=sum(row['bytes'] for row in index['archives']))
|
| 631 |
+
atomic_json(path, index)
|
| 632 |
+
if publisher:
|
| 633 |
+
- publisher.small(f'{component}/{name}/index.json', path)
|
| 634 |
+
+ publisher.small(f'{remote_root}/index.json', path)
|
| 635 |
+
return index
|
| 636 |
+
|
| 637 |
+
|
| 638 |
+
@@ -363,6 +367,8 @@ def publish(repo, output, names, *, monitor_views=16, optional=True, shard_bytes
|
| 639 |
+
atomic_json(status, {'phase': 'running', 'repo': repo, 'pid': os.getpid(), 'finished_dataset': name,
|
| 640 |
+
'datasets': list(recipe['datasets'])})
|
| 641 |
+
recipe['complete'] = True
|
| 642 |
+
+ from preprocess.ss_targets import retain_registered
|
| 643 |
+
+ retain_registered(recipe, repo, output)
|
| 644 |
+
atomic_json(output / 'training/index.json', recipe)
|
| 645 |
+
publisher.small('training/index.json', output / 'training/index.json')
|
| 646 |
+
atomic_json(status, {'phase': 'data_uploaded', 'repo': repo, 'pid': os.getpid(),
|
| 647 |
+
@@ -440,14 +446,20 @@ def _copy_files(api, repo, output, mapping, *, revision=LEGACY_REVISION, remove_
|
| 648 |
+
return commits
|
| 649 |
+
|
| 650 |
+
|
| 651 |
+
-def export_code(output, base_revision):
|
| 652 |
+
- """Export only this migration's source changes, preserving unrelated workspace edits."""
|
| 653 |
+
+def export_code(output, base_revision, *, tracked=None, added=None, name='reproduction'):
|
| 654 |
+
+ """Export selected source changes and preserve unrelated workspace edits."""
|
| 655 |
+
output = Path(output)
|
| 656 |
+
folder = output / 'code'
|
| 657 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 658 |
+
- tracked = ['HF_DATASETS.md', 'preprocess/slat/HUGGING_FACE.md', 'preprocess/slat/README.md', 'dataloader/dataset.py',
|
| 659 |
+
- 'dataloader/extent.py', 'preprocess/huggingface.py', 'preprocess/validate_dataset.py']
|
| 660 |
+
- added = ['preprocess/reproduction.py', 'preprocess/tests/test_reproduction.py']
|
| 661 |
+
+ if tracked is None:
|
| 662 |
+
+ runtime = subprocess.check_output(['git', 'ls-files', '--', 'ss_multiobj_depth',
|
| 663 |
+
+ 'utils/training', 'models/voxel_condition.py'], text=True).splitlines()
|
| 664 |
+
+ tracked = ['HF_DATASETS.md', 'preprocess/slat/HUGGING_FACE.md', 'preprocess/slat/README.md',
|
| 665 |
+
+ 'dataloader/dataset.py', 'dataloader/extent.py', 'preprocess/huggingface.py',
|
| 666 |
+
+ 'preprocess/validate_dataset.py', *runtime]
|
| 667 |
+
+ added = (['preprocess/reproduction.py', 'preprocess/tests/test_reproduction.py',
|
| 668 |
+
+ 'preprocess/ss_targets.py', 'preprocess/tests/test_ss_targets.py', 'preprocess/SS_TARGETS.md']
|
| 669 |
+
+ if added is None else added)
|
| 670 |
+
content = subprocess.check_output(['git', 'diff', '--binary', base_revision, '--', *tracked, *added])
|
| 671 |
+
for path in added:
|
| 672 |
+
present = subprocess.run(['git', 'cat-file', '-e', f'{base_revision}:{path}'],
|
| 673 |
+
@@ -461,11 +473,11 @@ def export_code(output, base_revision):
|
| 674 |
+
if result.returncode not in (0, 1):
|
| 675 |
+
raise RuntimeError(f'Cannot export restore source: {path}')
|
| 676 |
+
content += result.stdout
|
| 677 |
+
- patch = folder / 'reproduction.patch'
|
| 678 |
+
+ patch = folder / f'{name}.patch'
|
| 679 |
+
patch.write_bytes(content)
|
| 680 |
+
manifest = {'base_git_revision': base_revision, 'patch_sha256': sha256(patch),
|
| 681 |
+
'files': {path: sha256(path) for path in [*tracked, *added]}}
|
| 682 |
+
- atomic_json(folder / 'manifest.json', manifest)
|
| 683 |
+
+ atomic_json(folder / ('manifest.json' if name == 'reproduction' else f'{name}_manifest.json'), manifest)
|
| 684 |
+
return manifest
|
| 685 |
+
|
| 686 |
+
|
| 687 |
+
@@ -556,7 +568,11 @@ def write_card(output, recipe, repo):
|
| 688 |
+
'', '',
|
| 689 |
+
'', '',
|
| 690 |
+
'[Posed object geometry](previews/3dfront/train-geometry.glb)', '']
|
| 691 |
+
- (output / 'README.md').write_text('\n'.join(lines))
|
| 692 |
+
+ card = '\n'.join(lines)
|
| 693 |
+
+ if any(row.get('ss_targets') for row in recipe['datasets'].values()):
|
| 694 |
+
+ from preprocess.ss_targets import update_card
|
| 695 |
+
+ card = update_card(card, recipe, repo)
|
| 696 |
+
+ (output / 'README.md').write_text(card)
|
| 697 |
+
|
| 698 |
+
|
| 699 |
+
def finalize(repo, output, *, deprecate=False):
|
code/evaluation_manifest.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
{
|
| 2 |
"base_git_revision": "290027fe9f281a21db978a48da21bb9be90e5517",
|
| 3 |
-
"patch_sha256": "
|
| 4 |
"files": {
|
| 5 |
"dataloader/registry.py": "97690914f4c50c9f7d31213bb9dab174bc740cdd62bf7b217ccfe456b6b387e7",
|
| 6 |
"evaluation/artifacts.py": "232f1b6ffd0374813ea93857ecb378c317a962b2bfbbb4cce0fd7d28e88fe12c",
|
| 7 |
"evaluation/evaluate.py": "3d9115be9eb34e1e6193a31f3fb4e5bf770f60b70701dbf7d67017376b87ed17",
|
| 8 |
"evaluation/workflows.py": "0623408a288a31d5502531f377c5492b985b5dc69429858d21180eaf0b06d2ba",
|
| 9 |
-
"preprocess/huggingface.py": "
|
| 10 |
-
"preprocess/reproduction.py": "
|
| 11 |
"dataloader/frozen.py": "5efdb2209519d556f363599226d0d511de14009529899813b48a5574432bc508",
|
| 12 |
-
"preprocess/evaluation.py": "
|
| 13 |
"evaluation/configs/picasso_frozen.json": "5e691ad4b2266fb16f43c24c548a98bf3b68f139d471b956a36d0996a5b6492b",
|
| 14 |
"evaluation/configs/messykitchen_frozen.json": "b85423fbc37b16d64b57da59cb6bbde41194c1bf39cd065e72f7203f9f223a46",
|
| 15 |
"evaluation/configs/front3d_frozen.json": "661d67d3ba5f2a6a40f7dfbdbc5075e6f200ab14f94c8c90be0f8d285a54a07f"
|
|
|
|
| 1 |
{
|
| 2 |
"base_git_revision": "290027fe9f281a21db978a48da21bb9be90e5517",
|
| 3 |
+
"patch_sha256": "668d02c9a918602dc64f02d41d18f0bafe03d80dd740d78592e6bda4a801c70d",
|
| 4 |
"files": {
|
| 5 |
"dataloader/registry.py": "97690914f4c50c9f7d31213bb9dab174bc740cdd62bf7b217ccfe456b6b387e7",
|
| 6 |
"evaluation/artifacts.py": "232f1b6ffd0374813ea93857ecb378c317a962b2bfbbb4cce0fd7d28e88fe12c",
|
| 7 |
"evaluation/evaluate.py": "3d9115be9eb34e1e6193a31f3fb4e5bf770f60b70701dbf7d67017376b87ed17",
|
| 8 |
"evaluation/workflows.py": "0623408a288a31d5502531f377c5492b985b5dc69429858d21180eaf0b06d2ba",
|
| 9 |
+
"preprocess/huggingface.py": "4f83091cec7436760843f3261deb0ea5f0090a9c4d53918e2a543fe40f8ea31a",
|
| 10 |
+
"preprocess/reproduction.py": "cb0d302385fb7ca465cdf6970edeffcbad301f61a07770bb70d4b00d33549f22",
|
| 11 |
"dataloader/frozen.py": "5efdb2209519d556f363599226d0d511de14009529899813b48a5574432bc508",
|
| 12 |
+
"preprocess/evaluation.py": "e14f82038cb48a26098dc014f6b2db196e805ea5bca5402c560ac1b8ed944c8c",
|
| 13 |
"evaluation/configs/picasso_frozen.json": "5e691ad4b2266fb16f43c24c548a98bf3b68f139d471b956a36d0996a5b6492b",
|
| 14 |
"evaluation/configs/messykitchen_frozen.json": "b85423fbc37b16d64b57da59cb6bbde41194c1bf39cd065e72f7203f9f223a46",
|
| 15 |
"evaluation/configs/front3d_frozen.json": "661d67d3ba5f2a6a40f7dfbdbc5075e6f200ab14f94c8c90be0f8d285a54a07f"
|
{optional/evaluation → evaluation}/3dfront-00023.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/3dfront-00024.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/README.md
RENAMED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
# PartProbe3D frozen evaluation
|
| 2 |
|
| 3 |
This bundle contains 2,603 single-image evaluation samples and their GT object meshes.
|
|
|
|
|
|
|
| 4 |
It requires about 23.4 GB, including RGB images, visible masks, previews, and shared geometry.
|
| 5 |
It contains no training samples, depth maps, model weights, or image features.
|
| 6 |
|
|
@@ -25,11 +27,11 @@ hf download cubec/PartProbe3D-preprocessed code/evaluation.patch --repo-type dat
|
|
| 25 |
git apply --check outputs/huggingface/bootstrap/code/evaluation.patch
|
| 26 |
git apply outputs/huggingface/bootstrap/code/evaluation.patch
|
| 27 |
python -m pip install -e '.[preprocess]'
|
| 28 |
-
python -m preprocess.huggingface download --repo cubec/PartProbe3D-preprocessed --
|
| 29 |
```
|
| 30 |
|
| 31 |
The downloader pins one Hub revision and verifies every archive checksum before restoration.
|
| 32 |
-
The
|
| 33 |
Default training downloads exclude this bundle.
|
| 34 |
The source manifest at `code/evaluation_manifest.json` records the loader files and patch checksum.
|
| 35 |
|
|
|
|
| 1 |
# PartProbe3D frozen evaluation
|
| 2 |
|
| 3 |
This bundle contains 2,603 single-image evaluation samples and their GT object meshes.
|
| 4 |
+
The PartProbe3D benchmark requires this dataset.
|
| 5 |
+
The Hugging Face repository stores this dataset under `evaluation/`.
|
| 6 |
It requires about 23.4 GB, including RGB images, visible masks, previews, and shared geometry.
|
| 7 |
It contains no training samples, depth maps, model weights, or image features.
|
| 8 |
|
|
|
|
| 27 |
git apply --check outputs/huggingface/bootstrap/code/evaluation.patch
|
| 28 |
git apply outputs/huggingface/bootstrap/code/evaluation.patch
|
| 29 |
python -m pip install -e '.[preprocess]'
|
| 30 |
+
python -m preprocess.huggingface download --repo cubec/PartProbe3D-preprocessed --dataset evaluation
|
| 31 |
```
|
| 32 |
|
| 33 |
The downloader pins one Hub revision and verifies every archive checksum before restoration.
|
| 34 |
+
The required evaluation bundle restores to `datasets/evaluation/`.
|
| 35 |
Default training downloads exclude this bundle.
|
| 36 |
The source manifest at `code/evaluation_manifest.json` records the loader files and patch checksum.
|
| 37 |
|
{optional/evaluation → evaluation}/index.json
RENAMED
|
@@ -31,8 +31,8 @@
|
|
| 31 |
{
|
| 32 |
"file": "metadata.tar",
|
| 33 |
"bytes": 13086720,
|
| 34 |
-
"sha256": "
|
| 35 |
-
"identity": "
|
| 36 |
"files": 9,
|
| 37 |
"views": 0
|
| 38 |
},
|
|
@@ -238,5 +238,6 @@
|
|
| 238 |
}
|
| 239 |
],
|
| 240 |
"bytes": 23404277760,
|
| 241 |
-
"archive_prefix": "datasets/evaluation/indoor"
|
|
|
|
| 242 |
}
|
|
|
|
| 31 |
{
|
| 32 |
"file": "metadata.tar",
|
| 33 |
"bytes": 13086720,
|
| 34 |
+
"sha256": "9e5e5ea7f7b3dd012b6f9484f14d41758e0ed5843e0cec682a25ebc0c507989c",
|
| 35 |
+
"identity": "1d3d20302be51b87309bef221f8516ced8bb82d0a8644aae6844c0c63a8704b0",
|
| 36 |
"files": 9,
|
| 37 |
"views": 0
|
| 38 |
},
|
|
|
|
| 238 |
}
|
| 239 |
],
|
| 240 |
"bytes": 23404277760,
|
| 241 |
+
"archive_prefix": "datasets/evaluation/indoor",
|
| 242 |
+
"required_for_evaluation": true
|
| 243 |
}
|
{optional/evaluation → evaluation}/messykitchen-00001.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00002.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00003.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00004.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00005.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00006.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00007.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00008.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00009.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00010.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00011.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00012.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00013.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00014.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00015.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00016.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00017.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00018.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00019.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00020.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00021.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/messykitchen-00022.tar
RENAMED
|
File without changes
|
{optional/evaluation → evaluation}/metadata.tar
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 13086720
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e5e5ea7f7b3dd012b6f9484f14d41758e0ed5843e0cec682a25ebc0c507989c
|
| 3 |
size 13086720
|
{optional/evaluation → evaluation}/picasso-00000.tar
RENAMED
|
File without changes
|
training/index.json
CHANGED
|
@@ -84,18 +84,22 @@
|
|
| 84 |
"evaluation/ycbv": {
|
| 85 |
"component": "optional/evaluation/ycbv",
|
| 86 |
"bytes": 1669857280
|
| 87 |
-
},
|
| 88 |
-
"evaluation": {
|
| 89 |
-
"component": "optional/evaluation",
|
| 90 |
-
"bytes": 23404277760,
|
| 91 |
-
"views": 2603,
|
| 92 |
-
"datasets": {
|
| 93 |
-
"picasso": 100,
|
| 94 |
-
"messykitchen": 1503,
|
| 95 |
-
"3dfront": 1000
|
| 96 |
-
},
|
| 97 |
-
"loader_patch": "code/evaluation.patch"
|
| 98 |
}
|
| 99 |
},
|
| 100 |
-
"base_git_revision": "aac7b493e1e5e10512857a2582233c99fedda9c5"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
}
|
|
|
|
| 84 |
"evaluation/ycbv": {
|
| 85 |
"component": "optional/evaluation/ycbv",
|
| 86 |
"bytes": 1669857280
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
},
|
| 89 |
+
"base_git_revision": "aac7b493e1e5e10512857a2582233c99fedda9c5",
|
| 90 |
+
"evaluation": {
|
| 91 |
+
"component": "evaluation",
|
| 92 |
+
"bytes": 23404277760,
|
| 93 |
+
"views": 2603,
|
| 94 |
+
"datasets": {
|
| 95 |
+
"picasso": 100,
|
| 96 |
+
"messykitchen": 1503,
|
| 97 |
+
"3dfront": 1000
|
| 98 |
+
},
|
| 99 |
+
"loader_patch": "code/evaluation.patch",
|
| 100 |
+
"required": [
|
| 101 |
+
"evaluation"
|
| 102 |
+
],
|
| 103 |
+
"required_for_evaluation": true
|
| 104 |
+
}
|
| 105 |
}
|