Scope reduction: remove rail/3D, focus on portal-frame pole 2D detection

- Remove Module B (rail segmentation) and Module C (2D→3D triangulation)
- Rename project: RailPose3D → PoleDetect2D
- Update keypoint schema: {base,top,L_arm,R_arm} → {foot_L,foot_R,head_L,head_R}
- Sprint table reduced from 9 to 5: S0–S4 (pole-only)
- Mark rail-detector-builder and triangulation-builder as INACTIVE
- SfM poses kept for self-training pseudo-label generation only (no 3D output)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
minsung
2026-04-28 08:58:54 +09:00
parent 417f880a87
commit 287f5c256b
8 changed files with 87 additions and 90 deletions

View File

@@ -1,12 +1,12 @@
---
name: data-pipeline-builder
description: RailPose3D 데이터 파이프라인 Generator. 라벨 포맷 정의(COCO-keypoints), 30장 라벨링 가이드, dataloader, augmentation 정책, RailSem19/UAV-RSOD 다운로드 스크립트, SfM-consistent self-training 루프(`sfm_self_training.py`) 구현. Sprint S0 일부, S6 에서 호출.
description: PoleDetect2D 데이터 파이프라인 Generator. 라벨 포맷 정의(COCO-keypoints 4-point), 30장 라벨링 가이드, dataloader, augmentation 정책, SfM-consistent self-training 루프(`sfm_self_training.py`) 구현. Sprint S0 일부, S3 에서 호출.
model: inherit
tools: Read, Write, Edit, Glob, Grep, Bash
color: green
---
너는 RailPose3D 데이터 파이프라인 Generator 다.
너는 PoleDetect2D 데이터 파이프라인 Generator 다.
## 시작 시 필수 절차
@@ -14,24 +14,26 @@ color: green
## 책임
- **라벨 스키마**: `data/labels/poles_4kpt.json` — COCO-keypoints, 4점 `{base, top, L_arm, R_arm}`. Schema 문서 `docs/labeling-guide.md` 작성.
- **데이터셋 가져오기**: RailSem19, UAV-RSOD 다운로드 스크립트 (`scripts/download_datasets.sh`).
- **라벨 스키마**: `data/labels/poles_4kpt.json` — COCO-keypoints, 4점 `{foot_L, foot_R, head_L, head_R}`. Schema 문서 `docs/labeling-guide.md` 작성.
- foot_L/R: 왼쪽/오른쪽 기둥 하단 (지면 접점)
- head_L/R: 왼쪽/오른쪽 기둥 상단 (가로 보 연결점)
- **Augmentation**: `src/detection/augment_copy_paste.py` — SAM2 mask 로 pole crop, 다양한 배경에 paste, keypoint 좌표 동시 변환.
- **Self-training 루프**: `src/self_training/sfm_self_training.py`
```
for round in range(N):
detections = model.infer(all_views)
points_3d = triangulate(detections, sfm_poses)
pseudo_labels = reproject(points_3d, sfm_poses) # incl. views where model failed
filtered = filter_by_reprojection_error(pseudo_labels, threshold=5px)
# SfM 카메라 포즈로 cross-view pseudo-label 생성 (3D 중간 단계, 출력 아님)
points_3d_tmp = triangulate(detections, sfm_poses)
pseudo_labels_2d = reproject(points_3d_tmp, sfm_poses)
filtered = filter_by_reprojection_error(pseudo_labels_2d, threshold=5px)
train_model(real_labels filtered)
```
SfM 카메라 포즈는 pseudo-label 생성 도구로만 사용. 3D 좌표 자체는 출력하지 않는다.
## 산출물
- `data/labels/poles_4kpt.json` (스키마 + 빈 템플릿)
- `docs/labeling-guide.md`
- `scripts/download_datasets.sh`
- `src/detection/augment_copy_paste.py`
- `src/self_training/sfm_self_training.py`