Files
nbrightandClaude Opus 5 609d9a6972 Add SUM Parts reproduction and Seosan Myeongcheon application pipeline
Reproduces the SUM Parts (CVPR 2025) face-labeling benchmark on a single
consumer GPU, then applies it to drone-photogrammetry road survey meshes.

Verified on RTX 3060 12GB / WSL2 Ubuntu 22.04 / CUDA 11.8 / torch 2.0.1:
- CUDA extensions build (pointnet2_batch, pointops, chamfer_dist, emd,
  subsampling)
- PointNet 100 epochs reaches mIoU 17.19, matching the paper's reported 15.1
- OBJ -> PLY conversion round-trips through the model and yields per-point
  predictions

Four upstream source patches, all idempotent, originals preserved:
- numpy aliases removed in 1.24 (np.long etc.) and collections ABCs moved in
  python 3.10
- the blind test split ships label = -1, which crashed ConfusionMatrix
- mode=val referenced `epoch` before assignment

Documents the traps that cost the most time, including VRAM overflow silently
falling back to host RAM on WSL2 (25-100x slowdown, no OOM) and the colour
scale mismatch between r/g/b float32 and red/green/blue uint8.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 10:29:25 +09:00

69 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# SUM Parts - PointNeXt_bundle dependencies + CUDA extension build
#
# The upstream install.sh assumes python 3.7 / torch 1.12.1 / cu113 and pins
# requirements.txt to versions that no longer resolve on python 3.10.
# This script keeps the same package set but relaxes the pins, and drops
# packages that are not needed for the sumv2 segmentation task:
# - deepspeed (not used by the sumv2 training path, heavy build)
# - mkdocs-* (docs only)
# It also adds two packages the code needs but requirements.txt omits:
# - plyfile : imported by both sumv2 dataset loaders
# - wandb : main.py imports it at module scope, so it must exist even when
# wandb.use_wandb=False. Run with WANDB_MODE=disabled.
# NOTE: the chamfer_dist / emd extensions look reconstruction-only, but
# openpoints/models/__init__.py imports .reconstruction unconditionally, so
# segmentation runs need them too. build_ext.sh builds them.
set -euo pipefail
CONDA_ROOT="$HOME/miniconda3"
ENV_NAME="sumparts"
REPO="$HOME/sum-parts/semantic_segmentation/PointNeXt_bundle"
source "$CONDA_ROOT/etc/profile.d/conda.sh"
conda activate "$ENV_NAME"
# RTX 3060 == compute capability 8.6. Pin it so nvcc does not build every arch.
export TORCH_CUDA_ARCH_LIST="8.6"
export CUDA_HOME="$CONDA_PREFIX"
export PATH="$CUDA_HOME/bin:$PATH"
echo "=== [1/4] python deps ==="
# setuptools 69.5.1 : subsampling/setup.py imports numpy.distutils, which needs
# distutils.msvccompiler -- removed in setuptools 74.0. The extensions also
# still use `python setup.py install`, dropped in setuptools 80.
pip install --no-cache-dir "setuptools==69.5.1" wheel
pip install --no-cache-dir \
plyfile \
scikit-learn \
ninja \
easydict \
PyYAML \
tensorboard \
termcolor \
tqdm \
multimethod \
h5py \
matplotlib \
pandas \
shortuuid \
gdown \
Cython \
pyvista \
wandb \
trimesh \
pillow \
"numpy<2"
echo "=== [2/4] torch-scatter (matched to torch 2.0.1+cu118) ==="
pip install --no-cache-dir torch-scatter \
-f https://data.pyg.org/whl/torch-2.0.1+cu118.html
echo "=== [3/4] build CUDA extensions ==="
# Delegated to build_ext.sh so a failed compile can be retried on its own.
# That script also pins ninja==1.11.1.1 (torch 2.0 + ninja>=1.12 dies on SIGPIPE).
bash "$(dirname "$0")/build_ext.sh"
echo "POINTNEXT DONE"