Upload octformer-base.modelnet40.octree-nn
Browse files- README.md +112 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: torch-pointcloud
|
| 4 |
+
tags:
|
| 5 |
+
- point-cloud
|
| 6 |
+
- 3d
|
| 7 |
+
- pytorch
|
| 8 |
+
- torch-pointcloud
|
| 9 |
+
- octformer
|
| 10 |
+
- classification
|
| 11 |
+
datasets:
|
| 12 |
+
- modelnet40
|
| 13 |
+
model-index:
|
| 14 |
+
- name: octformer-base.modelnet40.octree-nn
|
| 15 |
+
results:
|
| 16 |
+
- task:
|
| 17 |
+
type: point-cloud-classification
|
| 18 |
+
dataset:
|
| 19 |
+
name: ModelNet40
|
| 20 |
+
type: modelnet40
|
| 21 |
+
metrics:
|
| 22 |
+
- name: OA
|
| 23 |
+
type: accuracy
|
| 24 |
+
value: 89.02
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Model card for octformer-base.modelnet40.octree-nn
|
| 28 |
+
|
| 29 |
+
An OctFormer point cloud classification model (octree-based windowed transformer). Trained on ModelNet40.
|
| 30 |
+
|
| 31 |
+
## Model Details
|
| 32 |
+
|
| 33 |
+
- **Model Type:** Point cloud classification
|
| 34 |
+
- **Model Stats:**
|
| 35 |
+
- Params (M): 4.0
|
| 36 |
+
- Input channels: 4
|
| 37 |
+
- Classes: 40
|
| 38 |
+
- Features: 192
|
| 39 |
+
- **Dataset:** ModelNet40
|
| 40 |
+
- **Metrics:** OA 89.02 (reference 92.7)
|
| 41 |
+
- **Paper:** [OctFormer: Octree-based Transformers for 3D Point Clouds](https://arxiv.org/abs/2305.03045)
|
| 42 |
+
- **Converted from:** [octree-nn/octformer](https://github.com/octree-nn/octformer) (MIT)
|
| 43 |
+
- **Library:** [torch-pointcloud](https://github.com/arthurdjn/pytorch-pointcloud)
|
| 44 |
+
|
| 45 |
+
## Install
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
pip install torch-pointcloud
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
import torch
|
| 55 |
+
import torch_pointcloud as tp
|
| 56 |
+
from torch_pointcloud.utils.data import collate
|
| 57 |
+
|
| 58 |
+
model, info = tp.create_model(
|
| 59 |
+
"octformer-base.modelnet40.octree-nn",
|
| 60 |
+
task="classification",
|
| 61 |
+
pretrained=True,
|
| 62 |
+
return_info=True,
|
| 63 |
+
)
|
| 64 |
+
model = model.cuda().eval() # GPU-only kernels
|
| 65 |
+
|
| 66 |
+
# synthetic sample with the keys a dataset provides
|
| 67 |
+
num_points = 8192
|
| 68 |
+
sample = {
|
| 69 |
+
"pos": torch.randn(num_points, 3),
|
| 70 |
+
"normal": torch.randn(num_points, 3),
|
| 71 |
+
"face": torch.randint(0, num_points, (2 * num_points, 3)),
|
| 72 |
+
}
|
| 73 |
+
data = info["transform"](sample)
|
| 74 |
+
data = collate([data])
|
| 75 |
+
data = {key: value.cuda() for key, value in data.items()}
|
| 76 |
+
|
| 77 |
+
with torch.no_grad():
|
| 78 |
+
logits = model(data.get("x"), data["octree"], data["octree"].depth)
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Feature extraction
|
| 82 |
+
|
| 83 |
+
```python
|
| 84 |
+
with torch.no_grad():
|
| 85 |
+
embeddings = model.forward_features(data.get("x"), data["octree"], data["octree"].depth)
|
| 86 |
+
|
| 87 |
+
model.reset_classifier(num_classes=0)
|
| 88 |
+
with torch.no_grad():
|
| 89 |
+
embeddings = model(data.get("x"), data["octree"], data["octree"].depth) # (B, 192)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## Citation
|
| 93 |
+
|
| 94 |
+
```bibtex
|
| 95 |
+
@article{wang2023octformer,
|
| 96 |
+
title = {OctFormer: Octree-based Transformers for 3D Point Clouds},
|
| 97 |
+
author = {Peng-Shuai Wang},
|
| 98 |
+
journal = {ACM Transactions on Graphics},
|
| 99 |
+
volume = {42},
|
| 100 |
+
number = {4},
|
| 101 |
+
year = {2023}
|
| 102 |
+
}
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
```bibtex
|
| 106 |
+
@inproceedings{wu2015modelnet,
|
| 107 |
+
title = {3D ShapeNets: A Deep Representation for Volumetric Shapes},
|
| 108 |
+
author = {Zhirong Wu and Shuran Song and Aditya Khosla and Fisher Yu and Linguang Zhang and Xiaoou Tang and Jianxiong Xiao},
|
| 109 |
+
booktitle = {CVPR},
|
| 110 |
+
year = {2015}
|
| 111 |
+
}
|
| 112 |
+
```
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a00060b63cac7d8148d0a40c680810c5625e7fa62f019454cc1d1bac923bbdcc
|
| 3 |
+
size 15964496
|