Add SpaceFormer weights (spaceformer_512_siglip2_ssccc) + model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: warpconvnet
|
| 4 |
+
pipeline_tag: image-segmentation
|
| 5 |
+
tags:
|
| 6 |
+
- 3d
|
| 7 |
+
- point-cloud
|
| 8 |
+
- instance-segmentation
|
| 9 |
+
- open-vocabulary
|
| 10 |
+
- scannet
|
| 11 |
+
- scannet200
|
| 12 |
+
- scannetpp
|
| 13 |
+
- replica
|
| 14 |
+
- spaceformer
|
| 15 |
+
- warpconvnet
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# SpaceFormer β Open-Vocabulary 3D Instance Segmentation
|
| 19 |
+
|
| 20 |
+
**SpaceFormer** performs **proposal-free, open-vocabulary 3D instance segmentation**.
|
| 21 |
+
A Mask2Former-style query decoder (learned queries + rotary position embeddings) runs
|
| 22 |
+
on top of the WarpConvNet [`SpaCeFormer`](https://github.com/NVlabs/WarpConvNet) sparse
|
| 23 |
+
point backbone. A single forward pass over an RGB point cloud produces a fixed set of
|
| 24 |
+
query masks plus a per-query CLIP feature; each mask is labeled by comparing its CLIP
|
| 25 |
+
feature against text embeddings of **arbitrary class names** (SigLIP2 text encoder, with
|
| 26 |
+
prompt ensembling). The vocabulary is chosen at inference time β it is not baked into the
|
| 27 |
+
weights β so the model can be queried with any label set.
|
| 28 |
+
|
| 29 |
+
Project page: https://nvlabs.github.io/SpaCeFormer/
|
| 30 |
+
|
| 31 |
+
## Model details
|
| 32 |
+
|
| 33 |
+
- **Task:** open-vocabulary 3D instance segmentation on RGB point clouds.
|
| 34 |
+
- **Architecture:** WarpConvNet `SpaCeFormer` backbone (mixed space/curve sparse
|
| 35 |
+
attention U-Net, `ssccc` encoder) β proposal-free query decoder (hidden dim 512,
|
| 36 |
+
200 learned queries, RoPE cross/self-attention, 3 decoder iterations) β objectness +
|
| 37 |
+
per-point mask + per-query CLIP heads. ~85.8M parameters.
|
| 38 |
+
- **CLIP/text embedding:** `google/siglip2-so400m-patch14-224` (1152-d), used only at
|
| 39 |
+
inference to embed class names; not stored in this checkpoint.
|
| 40 |
+
- **Input:** point coordinates in meters + RGB; voxelized internally at 2 cm.
|
| 41 |
+
- **Naming:** `spaceformer_512_siglip2_ssccc` = hidden dim 512 Β· SigLIP2 embedding Β·
|
| 42 |
+
`ssccc` encoder attention (space, space, curve, curve, curve).
|
| 43 |
+
|
| 44 |
+
## Evaluation
|
| 45 |
+
|
| 46 |
+
Test-set mAP with the released recipe (**prompt ensembling on, TTA off, default
|
| 47 |
+
proposal-free post-processing**):
|
| 48 |
+
|
| 49 |
+
| Benchmark | mAP | mAP50 | recall (class-agnostic) |
|
| 50 |
+
|---|---:|---:|---:|
|
| 51 |
+
| ScanNet200 | **0.1265** | 0.210 | 0.756 |
|
| 52 |
+
| ScanNet++ | 0.2217 | β | β |
|
| 53 |
+
| Replica | 0.2644 | β | β |
|
| 54 |
+
|
| 55 |
+
## How to use
|
| 56 |
+
|
| 57 |
+
The model lives in WarpConvNet as `warpconvnet.models.spaceformer` (the backbone needs
|
| 58 |
+
WarpConvNet's compiled CUDA extension β install a pre-built wheel or build from source).
|
| 59 |
+
It returns **raw** predictions; open-vocab labeling + mask post-processing live in the
|
| 60 |
+
demo repo / HuggingFace Space, not in WarpConvNet.
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
import torch
|
| 64 |
+
from warpconvnet.models.spaceformer import build_spaceformer, load_spaceformer_checkpoint
|
| 65 |
+
from huggingface_hub import hf_hub_download
|
| 66 |
+
|
| 67 |
+
device = torch.device("cuda")
|
| 68 |
+
ckpt = hf_hub_download("chrischoy/SpaCeFormer", "spaceformer_512_siglip2_ssccc.ckpt")
|
| 69 |
+
|
| 70 |
+
net = build_spaceformer(device=device)
|
| 71 |
+
load_spaceformer_checkpoint(net, ckpt) # 487 tensors, strict=False
|
| 72 |
+
|
| 73 |
+
# coord [N,3] float meters; feat [N,3] RGB in [-1,1]; offset [0, N]
|
| 74 |
+
out = net({"coord": coord, "feat": feat, "offset": offset})
|
| 75 |
+
# raw outputs: {"logit":[B,Q,2], "mask":List[[N,Q]], "clip_feat":[B,Q,1152]}
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
To turn `clip_feat` into open-vocabulary labels (SigLIP2 text + prompt ensembling) and
|
| 79 |
+
clean up masks (NMS/min-points), use the inference pipeline in the demo repo / Space
|
| 80 |
+
(`pipeline.py`, `clip_eval.py`, `text_encoder.py`, `postprocessing.py`, `labels.py`) β
|
| 81 |
+
e.g. its `inference.py` CLI or the Gradio `app.py`.
|
| 82 |
+
|
| 83 |
+
## Intended use & limitations
|
| 84 |
+
|
| 85 |
+
- **Intended:** research on open-vocabulary 3D scene understanding; segmenting indoor RGB
|
| 86 |
+
point clouds (ScanNet-like) against custom class vocabularies.
|
| 87 |
+
- **Open-vocab mAP is semantics-bottlenecked:** rare/fine-grained classes are weaker than
|
| 88 |
+
head classes; class-agnostic mask recall is higher than the open-vocab mAP.
|
| 89 |
+
- **Domain:** trained/evaluated on indoor scenes (ScanNet200 / ScanNet++ / Replica);
|
| 90 |
+
outdoor or very different sensor domains are out of distribution.
|
| 91 |
+
- **Large scenes:** very large clouds can exceed memory in the eval forward; the
|
| 92 |
+
inference code skips such a scene (single-process) rather than crashing.
|
| 93 |
+
|
| 94 |
+
## Files
|
| 95 |
+
|
| 96 |
+
- `spaceformer_512_siglip2_ssccc.ckpt` β weights-only Lightning `state_dict` (487
|
| 97 |
+
tensors; `net.*` decoder/backbone + `caption_loss.logit_scale`). Load via
|
| 98 |
+
`load_spaceformer_checkpoint` (strips the `net.` prefix, `strict=False`).
|
| 99 |
+
- `spaceformer_512_siglip2_ssccc.ckpt.provenance.json` β architecture, eval numbers, md5.
|
| 100 |
+
|
| 101 |
+
## License
|
| 102 |
+
|
| 103 |
+
Apache-2.0.
|
spaceformer_512_siglip2_ssccc.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac20817f6bab055483d2374c146c31050ae147c452f74123e43ef29f5ff9eed5
|
| 3 |
+
size 343397654
|
spaceformer_512_siglip2_ssccc.ckpt.provenance.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "spaceformer_512_siglip2_ssccc",
|
| 3 |
+
"model": "SpaCeFormerInstSeg (warpconvnet.models.spaceformer)",
|
| 4 |
+
"architecture": {
|
| 5 |
+
"hidden_dim": 512,
|
| 6 |
+
"clip_embedding": "siglip2-so400m-patch14-224 (1152-d)",
|
| 7 |
+
"encoder_attn_types": "ssccc",
|
| 8 |
+
"num_queries": 200,
|
| 9 |
+
"voxel_size": 0.02
|
| 10 |
+
},
|
| 11 |
+
"num_tensors": 487,
|
| 12 |
+
"num_params_million": 85.8,
|
| 13 |
+
"weights_only": true,
|
| 14 |
+
"md5": "0ec6a123b422053ed3988fbf442aeaa1",
|
| 15 |
+
"eval": {
|
| 16 |
+
"recipe": "prompt ensembling on, TTA off, default proposal-free post-processing",
|
| 17 |
+
"scannet200_map": 0.1265,
|
| 18 |
+
"scannetpp_map": 0.2217,
|
| 19 |
+
"replica_map": 0.2644
|
| 20 |
+
}
|
| 21 |
+
}
|