Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Formatter

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
16 changes: 16 additions & 0 deletions point_transformer_v3/external/pointcept_minimal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
image/
__pycache__
**/build/
**/*.egg-info/
**/dist/
*.so
exp
weights
data
*log*
outputs/
.vscode
.idea
*/.DS_Store
**/*.out
Dockerfile
21 changes: 21 additions & 0 deletions point_transformer_v3/external/pointcept_minimal/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Pointcept

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions point_transformer_v3/external/pointcept_minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Pointcept Minimal

A minimal version of [Pointcept](https://github.com/Pointcept/Pointcept) for comparing official PTv3 and fVDB PTv3 training results on ScanNet.

## Environment Setup

1. **fVDB-core**: Follow fVDB's installation instructions and install `env/dev_environment.yml`. Tested with fVDB commit `51cec3d3e90d7d571e22862d17ae9051cbd13afd`.
2. Activate the environment and install dependencies:
```bash
conda activate fvdb
pip install -r requirements_pointceptminimal.txt
```

## Dataset Preparation

Follow the [Pointcept scannet dataset preparation](https://github.com/Pointcept/Pointcept?tab=readme-ov-file#scannet-v2) to download ScanNet and prepare the dataset in the correct location.

## Training Configurations

### With Convolution (CPE)
Both configurations train PTv3 on ScanNet with convolution enabled. Training loss curves will diverge.

**fVDB PTv3:**
```bash
CUDA_VISIBLE_DEVICES=4,5,6,7 sh scripts/train.sh -g 4 -d scannet -c semseg-pt-v3m1-0-fvdb-test-4g-conv -n semseg-pt-v3m1-0-fvdb-test-4g-conv
```

**Official PTv3:**
```bash
CUDA_VISIBLE_DEVICES=4,5,6,7 sh scripts/train.sh -g 4 -d scannet -c semseg-pt-v3m1-0-test-4g-conv -n semseg-pt-v3m1-0-test-4g-conv
```

### Without Convolution (CPE)
Both configurations train PTv3 on ScanNet without convolution. Training loss curves are identical.

**fVDB PTv3:**
```bash
CUDA_VISIBLE_DEVICES=4,5,6,7 sh scripts/train.sh -g 4 -d scannet -c semseg-pt-v3m1-0-fvdb-test-4g -n semseg-pt-v3m1-0-fvdb-test-4g
```

**Official PTv3:**
```bash
CUDA_VISIBLE_DEVICES=0,1,2,3 sh scripts/train.sh -g 4 -d scannet -c semseg-pt-v3m1-0-test-4g -n semseg-pt-v3m1-0-test-4g
```

## Weights & Biases (Optional)

To enable W&B logging, set the following in your config file:
```python
enable_wandb = True
wandb_project = "your_project"
wandb_key = "your_key"
```
988 changes: 988 additions & 0 deletions point_transformer_v3/external/pointcept_minimal/README_pointcept.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class_names = [
"wall",
"floor",
"cabinet",
"bed",
"chair",
"sofa",
"table",
"door",
"window",
"bookshelf",
"picture",
"counter",
"desk",
"curtain",
"refridgerator",
"shower curtain",
"toilet",
"sink",
"bathtub",
"otherfurniture",
]

data = dict(
names=class_names,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
weight = None # path to model weight
resume = False # whether to resume training process
evaluate = True # evaluate after each epoch training process
test_only = False # test process

seed = None # train process will init a random seed and record
save_path = "exp/default"
num_worker = 16 # total worker in all gpu
batch_size = 16 # total batch size in all gpu
gradient_accumulation_steps = 1 # total steps to accumulate gradients for
batch_size_val = None # auto adapt to bs 1 for each gpu
batch_size_test = None # auto adapt to bs 1 for each gpu
epoch = 100 # total epoch, data loop = epoch // eval_epoch
eval_epoch = 100 # sche total eval & checkpoint epoch
clip_grad = None # disable with None, enable with a float

sync_bn = False
enable_amp = False
amp_dtype = "float16"
empty_cache = False
empty_cache_per_epoch = False
find_unused_parameters = False

enable_wandb = False
wandb_project = "pointcept" # custom your project name e.g. Sonata, PTv3
wandb_key = None # wandb token, default is None. If None, login with `wandb login` in your terminal

mix_prob = 0
param_dicts = None # example: param_dicts = [dict(keyword="block", lr_scale=0.1)]

memory_snapshot_enabled = False

# hook
hooks = [
dict(type="CheckpointLoader"),
dict(type="ModelHook"),
dict(type="IterationTimer", warmup_iter=2),
dict(type="InformationWriter"),
dict(type="SemSegEvaluator"),
dict(type="CheckpointSaver", save_freq=None),
dict(type="PreciseEvaluator", test_last=False),
]

# Trainer
train = dict(type="DefaultTrainer")

# Tester
test = dict(type="SemSegTester", verbose=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0

"""
Runtime configuration for FVDB-based Point Transformer V3 models.
"""

from __future__ import annotations

weight = None # path to model weight
resume = False # whether to resume training process
evaluate = True # evaluate after each epoch training process
test_only = False # test process

seed = None # train process will init a random seed and record
save_path = "exp/default"
num_worker = 16 # total worker in all gpu
batch_size = 16 # total batch size in all gpu
gradient_accumulation_steps = 1 # total steps to accumulate gradients for
batch_size_val = None # auto adapt to bs 1 for each gpu
batch_size_test = None # auto adapt to bs 1 for each gpu
epoch = 100 # total epoch, data loop = epoch // eval_epoch
eval_epoch = 100 # sche total eval & checkpoint epoch
clip_grad = None # disable with None, enable with a float

sync_bn = False
enable_amp = False
amp_dtype = "float16"
empty_cache = False
empty_cache_per_epoch = False
find_unused_parameters = False

enable_wandb = True
wandb_project = "pointcept" # custom your project name e.g. Sonata, PTv3
wandb_key = None # wandb token, default is None. If None, login with `wandb login` in your terminal

mix_prob = 0
param_dicts = None # example: param_dicts = [dict(keyword="block", lr_scale=0.1)]

# hook
hooks = [
dict(type="CheckpointLoader"),
dict(type="ModelHook"),
dict(type="IterationTimer", warmup_iter=2),
dict(type="InformationWriter"),
dict(type="SemSegEvaluator"),
dict(type="CheckpointSaver", save_freq=None),
dict(type="PreciseEvaluator", test_last=False),
]

# Trainer
train = dict(type="DefaultTrainer")

# Tester
test = dict(type="SemSegTester", verbose=True)
Loading