|
Download README.md from point-24/pointnsp: direct link, hf CLI and curl.
- Browser
- Download file 2.49 kB
-
https://huggingface.co/point-24/pointnsp/resolve/main/README.md
- Command line
-
hf download hf://point-24/pointnsp/README.md
-
curl -L -o README.md https://huggingface.co/point-24/pointnsp/resolve/main/README.md
2.49 kB
| # PointNSP: Autoregressive 3D Point Cloud Generation with Next-Scale Level-of-Detail Prediction | |
| A two-stage coarse-to-fine framework for high-quality 3D point cloud generation. Stage 1 learns multi-scale discrete representations via VQVAE; Stage 2 autoregressively predicts next-scale tokens via a causal transformer. | |
| ## Dataset | |
| Download the ShapeNet point clouds (pre-sampled 15k points) from this [link](https://drive.google.com/drive/folders/1MMRp7mMvRj8-tORDaGTJvrAeCMYTWU2j) and place under `data/`: | |
| ``` | |
| data/ShapeNetCore.v2.PC15k/ | |
| βββ 02691156/ # airplane | |
| β βββ train/ | |
| β βββ val/ | |
| β βββ test/ | |
| βββ 03001627/ # chair | |
| βββ 02958343/ # car | |
| βββ ... | |
| ``` | |
| ## Training | |
| ### Stage 1: Multi-Scale VQVAE | |
| ```bash | |
| # PointNSP-m (paper default: hidden=1024, codebook=8192, 10 scales) | |
| python train_vqvae.py --config configs/vqvae_medium.yaml | |
| # PointNSP-s (lightweight: hidden=512, codebook=4096) | |
| python train_vqvae.py --config configs/vqvae_small.yaml | |
| # Resume from checkpoint | |
| python train_vqvae.py --config configs/vqvae_medium.yaml --resume checkpoints/vqvae_best.pt | |
| ``` | |
| ### Stage 2: Autoregressive Transformer | |
| ```bash | |
| # Online tokenization (stochastic FPS augmentation each epoch) | |
| python train_transformer.py --config configs/transformer_medium.yaml \ | |
| --vqvae_ckpt checkpoints/vqvae_best.pt | |
| # Fast training with pre-tokenized data | |
| python train_transformer_fast.py --config configs/transformer_medium.yaml \ | |
| --tokenized_data data/tokenized/airplane_train.pt | |
| ``` | |
| ### Generation | |
| ```bash | |
| python generate.py \ | |
| --vqvae_ckpt checkpoints/vqvae_best.pt \ | |
| --transformer_ckpt checkpoints/transformer_best.pt \ | |
| --num_samples 64 \ | |
| --output_dir generated/ | |
| ``` | |
| ## Project Structure | |
| ``` | |
| model/ | |
| βββ vqvae_model.py # Multi-Scale VQVAE (Algorithm 1 & 2) | |
| βββ transformer.py # Autoregressive Transformer (Stage 2) | |
| βββ pvcnn/ # Point-Voxel CNN encoder | |
| βββ fps.py # Farthest Point Sampling + LoD sequence | |
| βββ upsampling.py # PU-Net upsampling | |
| βββ positional_encoding.py # BAPE + scale embedding | |
| βββ masking.py # Block-wise causal mask + position-aware soft mask | |
| configs/ # YAML configs for PointNSP-s and PointNSP-m | |
| datasets/ # ShapeNet data loaders | |
| tests/ # Unit tests (66 tests) | |
| ``` | |
| ## Tests | |
| ```bash | |
| python -m pytest tests/ -v | |
| ``` | |