cubec commited on
Commit
b101e4e
·
verified ·
1 Parent(s): 23c1141

Publish code/reproduction.patch

Browse files
Files changed (1) hide show
  1. code/reproduction.patch +118 -2
code/reproduction.patch CHANGED
@@ -853,10 +853,126 @@ index dee49f8..6252056 100644
853
  +The [original upload report](../../reports/slat_targets_huggingface_20261015.md) records their coverage and codec identities.
854
  +Exact checkpoint resume requires the checkpoint's original data and feature identities.
855
  diff --git a/preprocess/slat/README.md b/preprocess/slat/README.md
856
- index 46e4436..663732a 100644
857
  --- a/preprocess/slat/README.md
858
  +++ b/preprocess/slat/README.md
859
- @@ -181,42 +181,31 @@ Training resume also checks cache provenance and latent target checksums.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
860
 
861
  ## Hugging Face snapshots
862
 
 
853
  +The [original upload report](../../reports/slat_targets_huggingface_20261015.md) records their coverage and codec identities.
854
  +Exact checkpoint resume requires the checkpoint's original data and feature identities.
855
  diff --git a/preprocess/slat/README.md b/preprocess/slat/README.md
856
+ index 46e4436..c5f93e5 100644
857
  --- a/preprocess/slat/README.md
858
  +++ b/preprocess/slat/README.md
859
+ @@ -1,7 +1,7 @@
860
+ # SLAT preparation
861
+
862
+ This stage prepares reusable training inputs for multi-object SLAT shape finetuning.
863
+ -It reads the saved 3D-FRONT and SAGE-10k extent datasets after capture and voxel export.
864
+ +It reads saved extent datasets from 3D-FRONT, SAGE-10k, and FoundationPose after capture and voxel export.
865
+ It preserves each saved cube, object identity, and room or layout split.
866
+
867
+ The generation implementation and its configurations reside in this package.
868
+ @@ -11,6 +11,95 @@ The generation implementation and its configurations reside in this package.
869
+ | `targets.py` | Select posed meshes, preserve the saved cube, and write object and scene targets |
870
+ | `encode.py` | Convert meshes to dual grids and apply the frozen pretrained shape encoder |
871
+ | `prepare.py` | Coordinate dataset phases and extract frozen conditioning features |
872
+ +| `scene_targets.py` | Export one scene token per reference voxel with an explicit latent validity flag |
873
+ +
874
+ +## Aligned scene targets at 32³
875
+ +
876
+ +The scene export combines complete meshes for all prompted objects before one frozen shape encoder processes them.
877
+ +It preserves each training view's saved cube, calibration, object order, and dataset split.
878
+ +Different views of one room can use different cubes.
879
+ +The export therefore retains each view ID.
880
+ +
881
+ +Reference voxels are the union of complete occupancy for prompted objects.
882
+ +The shared `prompt_object_cells` function selects these voxels from saved 64³ targets and pools them to 32³.
883
+ +Unprompted objects do not add reference voxels.
884
+ +Older feature caches can contain extra scene voxels from unprompted objects.
885
+ +Those extra rows do not define the reference occupancy for this export.
886
+ +
887
+ +Each reference voxel has exactly one scene token, including voxels that contain multiple objects.
888
+ +The native scene encoder can omit a small number of reference voxels because its rasterization method differs.
889
+ +The export retains those coordinates with zero feature storage and `latent_valid=false`.
890
+ +Training must exclude invalid rows from the latent loss.
891
+ +The export does not average object latents or interpolate missing values.
892
+ +
893
+ +| Array | Shape | Meaning |
894
+ +| --- | --- | --- |
895
+ +| `coords` | `[N, 3]` | Unique reference coordinates in sorted order, stored as `uint8` |
896
+ +| `feats` | `[N, 32]` | Physical scene latents stored as `float16`, with zeros at invalid rows |
897
+ +| `latent_valid` | `[N]` | Boolean flag for an exact coordinate match with native scene encoding |
898
+ +| `memberships` | `[N, K]` | Independent per-object voxel occupancy for the same reference rows |
899
+ +| `object_ids` | `[K]` | Prompt identities in the saved order |
900
+ +| `model_to_world` | `[4, 4]` | Original transform from the normalized cube to world coordinates |
901
+ +
902
+ +Multiple columns of `memberships` can be positive at one voxel.
903
+ +They do not create additional scene tokens.
904
+ +
905
+ +Run the combined export from the repository root:
906
+ +
907
+ +```bash
908
+ +python -m preprocess.slat.scene_targets \
909
+ + --config preprocess/slat/configs/scenes_32.json
910
+ +```
911
+ +
912
+ +The configuration selects training views only and uses GPUs 0, 1, and 2.
913
+ +Sixteen CPU processes prepare meshes for six persistent GPU workers.
914
+ +Each GPU hosts two encoder processes.
915
+ +Each GPU worker uses four CPU threads to prepare native dual grids while the GPU encodes earlier grids.
916
+ +The `mesh_workers` and `raster_workers` settings control these CPU counts.
917
+ +The latter count applies separately to each GPU worker.
918
+ +The `mesh_executor` setting selects CPU processes or threads.
919
+ +CPU processes avoid Python thread contention during mesh preparation.
920
+ +They transfer geometry and reference metadata without RGB or depth tensors.
921
+ +Prefetch retains a bounded number of grids in memory.
922
+ +
923
+ +Mesh clipping omits plane cuts when all vertices lie strictly inside the plane.
924
+ +Vertices near a clipping plane retain the original Trimesh procedure.
925
+ +These changes preserve the cube, rasterization settings, encoder weights, and reference voxels.
926
+ +
927
+ +Its `encoder_config` selects the existing codec weights, dual-grid settings, and native Python environment.
928
+ +Each dataset saves its targets under `datasets/<dataset>/slat/32/scene_targets/`.
929
+ +The format identifier is `slat-scene-targets-v1`.
930
+ +Logs and combined progress reside under `outputs/slat_scene/32/preparation/`.
931
+ +
932
+ +The export reuses completed native scene encodings after it checks their dataset, cube, prompts, codec, and file checksums.
933
+ +Existing object caches retain their original files.
934
+ +Per-view completion records support resume after an interruption.
935
+ +Resume retries failed encodings and replaces corrupt output files.
936
+ +
937
+ +Add `--limit-per-dataset 2` for a short GPU check.
938
+ +Repeat the command without that argument to complete every training view.
939
+ +The command finishes active jobs before it honors SIGINT or SIGTERM.
940
+ +The default storage reserve stops preparation if free space falls below 20 GiB.
941
+ +
942
+ +`dataloader.slat_scene.SceneTargetDataset` reads one or more exported caches without loading meshes.
943
+ +It checks exact reference coordinates, occupancy labels, object identities, and cube transforms against the saved extent views.
944
+ +It normalizes valid latents with the pretrained flow statistics and keeps invalid rows zero.
945
+ +
946
+ +### Test native latent equivalence
947
+ +
948
+ +Run the regression with the actual pretrained encoder:
949
+ +
950
+ +```bash
951
+ +PARTPROBE3D_NATIVE_SLAT_TEST=1 python -m pytest \
952
+ + preprocess/tests/test_slat_native_equivalence.py -q
953
+ +```
954
+ +
955
+ +This test requires the native CUDA environment and existing codec checkpoints.
956
+ +Set `PARTPROBE3D_NATIVE_SLAT_DEVICE` to select a GPU other than `cuda:0`.
957
+ +The test compares original serial preparation with optimized clipping and four CPU threads for rasterization.
958
+ +It covers inside meshes, clipped meshes, and overlapping objects encoded together.
959
+ +It requires identical coordinates and identical stored `float16` latents with zero tolerance.
960
+ +The normal test suite skips this GPU test unless the environment flag enables it.
961
+
962
+ ## Prepared data
963
+
964
+ @@ -84,8 +173,8 @@ Scene encoding preserves object failures and includes their selected meshes in t
965
+ Failed objects still require successful encoding before feature extraction or finetuning.
966
+
967
+ Resume preserves completed object and scene latents.
968
+ -The cached training configurations supervise objects and do not require scene targets.
969
+ -Configurations with `require_scene_targets=true` retain scene supervision in their feature caches.
970
+ +All shape training configurations supervise object latents only.
971
+ +Feature caches exclude scene supervision, while target exports retain scene latents for diagnostics.
972
+
973
+ 1. Prepare targets and features for both training datasets.
974
+
975
+ @@ -181,42 +270,31 @@ Training resume also checks cache provenance and latent target checksums.
976
 
977
  ## Hugging Face snapshots
978