#!/usr/bin/env bash # SUM Parts - put the Seosan prediction somewhere it can be opened and looked at # # Two files, because they answer different questions: # *_pred_viewer.ply class colours -> where did each class land # *_rgb_viewer.ply photo texture -> what is actually there # # Open both, flip between them. That is how you find out whether the 21% the # model calls water is asphalt, shadow, or something else entirely. set -uo pipefail SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" LOGROOT="$HOME/sum-parts/semantic_segmentation/PointNeXt_bundle/examples/segmentation/log/sumv2_triangle" DEST="/mnt/d/MYCLAUDE_PROJECT/sum-parts-test/output" source "$HOME/miniconda3/etc/profile.d/conda.sh" conda activate sumparts mkdir -p "$DEST" PRED=$(find "$LOGROOT" -name 'seosan*_pred.ply' -printf '%T@ %p\n' 2>/dev/null \ | sort -rn | head -1 | cut -d' ' -f2-) [ -n "$PRED" ] || { echo "no seosan prediction found"; exit 1; } echo "prediction : $PRED" cp "$PRED" "$DEST/seosan_pred_viewer.ply" echo " -> $DEST/seosan_pred_viewer.ply" SRC="$HOME/sum-parts/data/korea_poc/seosan_BlockYBA_tile0.ply" if [ -f "$SRC" ]; then python "$SCRIPTS/ply_for_viewer.py" "$SRC" "$DEST/seosan_rgb_viewer.ply" fi echo echo "=== class colour legend ===" python - <<'PY' CLASSES = ['unclassified', 'terrain', 'high_vegetation', 'facade_surface', 'water', 'car', 'boat', 'roof_surface', 'chimney', 'dormer', 'balcony', 'roof_installation', 'wall'] COLORS = [(0,0,0), (170,85,0), (0,255,0), (255,255,0), (0,255,255), (255,0,255), (0,0,153), (85,85,127), (255,50,50), (85,0,127), (50,125,150), (50,0,50), (215,160,140)] for i, (n, c) in enumerate(zip(CLASSES, COLORS)): print(f" {i:>2} {n:<20} RGB {c}") PY echo ls -lh "$DEST"/seosan_*viewer.ply