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>
65 lines
2.0 KiB
Bash
65 lines
2.0 KiB
Bash
#!/usr/bin/env bash
|
|
# SUM Parts - A/B the validation protocol on the same checkpoint
|
|
#
|
|
# Training reported val_miou 17.19 @E90, but a standalone mode=val gave 4.20.
|
|
# The only difference is dataset.val.voxel_max:
|
|
#
|
|
# A) 64000 what training used after the memory mitigation (§3-2-1),
|
|
# i.e. validation on a 64k-point crop, matching the training
|
|
# input size
|
|
# B) null the cfg's own default: the whole ~700k-point tile in one
|
|
# forward pass
|
|
#
|
|
# PointNet pools a single global feature over whatever it is given, so input
|
|
# size is not a neutral knob -- this measures how much it moved the number.
|
|
set -uo pipefail
|
|
|
|
CONDA_ROOT="$HOME/miniconda3"
|
|
SEG="$HOME/sum-parts/semantic_segmentation/PointNeXt_bundle/examples/segmentation"
|
|
DATA="$HOME/sum-parts/data/face_labeling/texsp_pcl"
|
|
OUT="$HOME/sum-parts/runs/val_ab"
|
|
|
|
source "$CONDA_ROOT/etc/profile.d/conda.sh"
|
|
conda activate sumparts
|
|
export WANDB_MODE=disabled WANDB_SILENT=true CUDA_HOME="$CONDA_PREFIX"
|
|
export PYTORCH_CUDA_ALLOC_CONF="garbage_collection_threshold:0.7,max_split_size_mb:128"
|
|
|
|
mkdir -p "$OUT"
|
|
cd "$SEG"
|
|
|
|
CKPT="${CKPT:-$(find "$SEG/log/sumv2_triangle" -name '*_ckpt_best.pth' -printf '%T@ %p\n' \
|
|
| sort -rn | head -1 | cut -d' ' -f2-)}"
|
|
echo "checkpoint: $(basename "$CKPT")"
|
|
echo
|
|
|
|
run_val() {
|
|
local tag="$1"; shift
|
|
local log="$OUT/val_${tag}.log"
|
|
python -u main.py \
|
|
--cfg ../../cfgs/sumv2_triangle/pointnet.yaml \
|
|
mode=val \
|
|
--pretrained_path "$CKPT" \
|
|
dataset.common.data_root="$DATA" \
|
|
wandb.use_wandb=False \
|
|
val_batch_size=1 \
|
|
"$@" \
|
|
> "$log" 2>&1
|
|
local rc=$?
|
|
if [ $rc -ne 0 ]; then
|
|
echo " [$tag] FAILED rc=$rc"
|
|
tail -6 "$log"
|
|
return 1
|
|
fi
|
|
grep -aA1 'Best ckpt' "$log" | tail -2 | sed "s/^/ [$tag] /"
|
|
}
|
|
|
|
echo "=== A: voxel_max 64000 (what training measured) ==="
|
|
run_val capped dataset.val.voxel_max=64000
|
|
echo
|
|
|
|
echo "=== B: voxel_max null (cfg default, whole tile) ==="
|
|
run_val full
|
|
echo
|
|
|
|
echo "logs in $OUT"
|