#!/usr/bin/env bash # SUM Parts - run inference on the converted Korean tile # # This answers one question: does a SUM Parts model accept our data and emit # per-point predictions? It does NOT measure anything. The checkpoint is the # 1-epoch smoke-test model and the tile carries label=0 everywhere, so the # reported mIoU/OA are meaningless by construction. Look at whether it runs and # what the predicted class histogram looks like, nothing else. set -euo pipefail CONDA_ROOT="$HOME/miniconda3" ENV_NAME="sumparts" REPO="$HOME/sum-parts/semantic_segmentation/PointNeXt_bundle" SEG="$REPO/examples/segmentation" TILE="$HOME/sum-parts/data/korea_poc/seosan_BlockYBA_tile0.ply" TRACK="$HOME/sum-parts/data/korea_poc_track" LOG="${LOG:-/tmp/sumparts_poc_infer.log}" source "$CONDA_ROOT/etc/profile.d/conda.sh" conda activate "$ENV_NAME" export WANDB_MODE=disabled WANDB_SILENT=true export CUDA_HOME="$CONDA_PREFIX" [ -f "$TILE" ] || { echo "error: $TILE missing -- run poc_korea.sh first" >&2; exit 1; } # The dataset class globs {train,val,test}/*.ply and errors on a missing split, # so all three have to exist even for a test-only run. for split in train val test; do mkdir -p "$TRACK/$split" ln -f "$TILE" "$TRACK/$split/$(basename "$TILE")" done rm -rf "$TRACK/processed" CKPT=$(find "$SEG/log/sumv2_triangle" -name '*_ckpt_best.pth' -printf '%T@ %p\n' \ | sort -rn | head -1 | cut -d' ' -f2-) [ -n "$CKPT" ] || { echo "error: no checkpoint found -- run smoke_train.sh first" >&2; exit 1; } echo "checkpoint: $CKPT" cd "$SEG" set +e python -u main.py \ --cfg ../../cfgs/sumv2_triangle/pointnet.yaml \ mode=test \ --pretrained_path "$CKPT" \ dataset.common.data_root="$TRACK" \ wandb.use_wandb=False \ batch_size=2 \ val_batch_size=1 \ > "$LOG" 2>&1 rc=$? set -e echo "=== exit=$rc | last 25 lines ===" tail -25 "$LOG" [ "$rc" -eq 0 ] && echo "POC INFER DONE" || echo "POC INFER FAILED (rc=$rc)" exit "$rc"