nbrightandClaude Opus 5 f39b093106 Record results so far and fix the memory blowup in the palette decode
Adds STATUS.md as the handoff document: benchmark numbers, the bare-earth
metrics that actually matter for this project, the Korean-data domain gap that
retraining will not fix, and what to do on the 24 GB machine.

The memory problem was in how a prediction's colours were turned back into
class indices. Every consumer built an (N, 13, 3) float64 temporary:

    d = ((rgb[:, None, :] - COLOR_MAP[None, :, :]) ** 2).sum(axis=2)

That is ~250 MB of intermediates per 800k-point tile, several live at once, and
a full 4.7M-point block pushes it into gigabytes. main.py writes exact palette
entries, so an exact hash lookup resolves nearly every point with no large
temporary; only leftovers fall back to a chunked distance search. Peak RSS on a
470k-point tile drops to 61 MB. Extracted to sumparts_palette.py and shared by
coarse_eval.py and split_by_class.py.

Also from this round:

- patch_cm_mutation.sh: ConfusionMatrix.update() rewrote the caller's pred
  tensor in place, folding every ignore_index point into class num_classes-1.
  test() saves its visualization from that same tensor afterwards, so an
  unlabelled tile came out 100% wall and the model looked degenerate when it
  was not.
- patch_class_mask.sh: SUMPARTS_MASK_CLASSES drops known-absent classes from
  the argmax. Measured on Seosan and it does not help - the runner-up for
  "water" is "wall", not "terrain" - but the experiment is worth keeping.
- split_by_class.py now writes .ply alongside .obj. A vertex-only OBJ has zero
  faces and most viewers render nothing, which is why the first export looked
  broken.
- verify_outputs.sh reads exported files back with a parser, so "here are your
  files" can be checked rather than asserted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 09:07:31 +09:00

sum-parts-test

드론 사진측량 메시를 건물 / 수목 / 차량 / 지면으로 분할하기 위한 SUM Parts (CVPR 2025) 재현 및 적용 작업.

대상 데이터: 서산 명천 도로 프로젝트 — ContextCapture OBJ 6블록, EPSG:5186.

문서

경로 내용
STATUS.md 현재 상태·결과·미해결 문제 — 이어받을 때 여기부터
SETUP.md 1단계 — 환경 구축 (GPU 불필요)
TRAIN.md 2단계 — 학습 (GPU 필요)
docs/pipeline.html 전체 6단계 공정 정의 (브라우저로 열 것)
docs/SUM-Parts-검토노트.md 트러블슈팅 16건, 데이터 스키마 실측, 라이선스
scripts/ 환경 구축 · 학습 · 평가 · 변환 스크립트

데이터와 체크포인트는 커밋하지 않는다(.gitignore). 스크립트로 재생성한다.

왜 두 단계로 나눴나

CUDA 확장 빌드는 nvcc 컴파일이지 GPU 실행이 아니다. 데이터 다운로드도 마찬가지다. 오래 걸리는 작업(빌드 50분 + 데이터 30분)이 전부 GPU 없이 되므로, 카드가 남의 작업에 물려 있어도 1단계를 미리 끝낼 수 있다.

GPU 시간
1단계 · 환경 구축 불필요 ~80분
2단계 · 학습·평가 필요 3~6시간

2단계는 카드가 바쁘면 실패하지 않고 빌 때까지 기다린다.

빠른 시작 (무인)

# HF 토큰 — 유일한 수동 작업. 게이트는 계정 단위라 토큰만 옮기면 된다
mkdir -p ~/.cache/huggingface && echo hf_xxxxx > ~/.cache/huggingface/token

# 1단계 — GPU 불필요
bash scripts/selfcheck.sh                     # 스크립트 무결성
RUN_DRYRUN=1 bash scripts/run_setup.sh        # 전제조건 검사
setsid nohup bash scripts/keepalive.sh setup > ~/keepalive-setup.out 2>&1 &

# 2단계 — GPU 필요. 바쁘면 빌 때까지 대기
setsid nohup bash scripts/keepalive.sh train > ~/keepalive-train.out 2>&1 &

확인:

cat ~/sum-parts/runs/setup/STATUS
cat ~/sum-parts/runs/train/STATUS
cat ~/sum-parts/runs/coarse_eval/coarse.txt   # 4클래스 통합 성적 ← 핵심

멈춰도 이어간다 — 감시자가 재기동하고, 학습은 체크포인트에서 재개한다.

요약

  • 모델: PointVector (논문 mIoU 70.0 %, 번들 최고이자 최속)
  • 학습 자산: SUM Parts face 트랙 13클래스 → 우리 4클래스로 통합
  • 제약: 저자가 학습 가중치를 공개하지 않아 직접 학습이 유일한 경로
  • VRAM: 논문 설정 voxel_max 64000은 약 16.5 GB 필요 → 12 GB 카드 불가, 24 GB 필요

라이선스

스크립트와 문서는 자유롭게 쓰되, 참조하는 SUM Parts는 데이터 CC BY-NC 4.0 / 코드 GPL-3.0이다. 상업 이용은 원저자 허락이 필요하다.

S
Description
SUM Parts (CVPR 2025) 재현 + 서산 명천 드론 메시 세그멘테이션 파이프라인. 건물/수목/차량/지면 4클래스 분할.
Readme
7.4 MiB
Languages
Shell 69.4%
Python 30.6%