sam31server 서버 전환 및 라멘 파이프라인 문서화 #1

Closed
opened 2026-06-02 10:11:39 +09:00 by kimminsung · 0 comments
Owner

작업 요약

1. SAM3.1 서버 전환 (x-anylabeling01 → sam31server)

기존 x-anylabeling01/X-AnyLabeling-Server에서 서빙하던 SAM 3.1을 독립 프로젝트 sam31server로 이전.

변경 내용:

  • sam31server/app/ — FastAPI 서버 코드 복사 (app/models/sam3 제외, root sam3 패키지 사용)
  • sam31server/configs/ — server.yaml, models.yaml, auto_labeling/*.yaml 복사
  • sam31server/bpe_simple_vocab_16e6.txt.gz — BPE 어휘 파일 복사
  • app/models/segment_anything_3.py sys.path 수정 → sam31server 루트 포인트
  • configs/auto_labeling/segment_anything_3.yaml bpe_path 경로 수정
  • configs/models.yaml → segment_anything_3 만 활성화
  • edt.py triton 조건부 import + scipy CPU fallback 추가
  • 누락 패키지 설치: triton-windows==3.6.0.post25, decord, ftfy

서버 시작:

cd D:\MYCLAUDE_PROJECT\sam31server
.venv\Scripts\python.exe -m app.main

2. 라멘형(門) 전철주 검출 파이프라인 정리

2단계 파이프라인:

Step 1: detect_all_objects.py  →  catenary_pole JSON annotation 생성
Step 2: detect_raamen.py       →  B(Beam)/C(Column) 분류 + 라멘 그룹 판정

B/C 접두어:

  • C (Column) — 소실점 방향으로 향하는 기둥 폴리곤 (--c-thresh 20° 이내)
  • B (Beam) — 수평 빔 폴리곤 (소실점 방향에서 크게 벗어남)
  • 판정 기준: B 1개 + 하단 C 2개 이상 → 門자형 라멘
# Step 1
python tools/detect_all_objects.py \
  --input "data/역사구간/..." \
  --categories configs/railway_zone.json \
  --tiles all --cols 4 --rows 3 --overlap 0.10 --workers 2

# Step 2
python tools/detect_raamen.py \
  --image "data/역사구간/.../image.JPG" \
  --label "output/detect/image.json" \
  --output "output/raamen/image_raamen.png"

3. Everything 탐색 모드 문서화

sam3_everything_explore.py — Discovery Prompt (~20종 키워드)로 이미지 전체 객체를 타일 sweep, 라벨 빈도 집계.

python tools/sam3_everything_explore.py \
  --input "data/역사구간/.../image.JPG" \
  --cols 8 --rows 6 --conf 0.10 --workers 4

→ 빈도 상위 라벨을 railway_zone.json 프롬프트 튜닝에 활용.


4. 문서 생성

docs/railway-client-guide.html — 다크테마 HTML 가이드

  • 라멘 파이프라인 최우선 배치
  • Everything 모드 상세
  • 서버 설정·API 스키마
  • 카테고리 15종 색상표
  • 트러블슈팅 테이블
## 작업 요약 ### 1. SAM3.1 서버 전환 (x-anylabeling01 → sam31server) 기존 `x-anylabeling01/X-AnyLabeling-Server`에서 서빙하던 SAM 3.1을 독립 프로젝트 `sam31server`로 이전. **변경 내용:** - `sam31server/app/` — FastAPI 서버 코드 복사 (app/models/sam3 제외, root sam3 패키지 사용) - `sam31server/configs/` — server.yaml, models.yaml, auto_labeling/*.yaml 복사 - `sam31server/bpe_simple_vocab_16e6.txt.gz` — BPE 어휘 파일 복사 - `app/models/segment_anything_3.py` sys.path 수정 → sam31server 루트 포인트 - `configs/auto_labeling/segment_anything_3.yaml` bpe_path 경로 수정 - `configs/models.yaml` → segment_anything_3 만 활성화 - `edt.py` triton 조건부 import + scipy CPU fallback 추가 - 누락 패키지 설치: `triton-windows==3.6.0.post25`, `decord`, `ftfy` **서버 시작:** ``` cd D:\MYCLAUDE_PROJECT\sam31server .venv\Scripts\python.exe -m app.main ``` --- ### 2. 라멘형(門) 전철주 검출 파이프라인 정리 **2단계 파이프라인:** ``` Step 1: detect_all_objects.py → catenary_pole JSON annotation 생성 Step 2: detect_raamen.py → B(Beam)/C(Column) 분류 + 라멘 그룹 판정 ``` **B/C 접두어:** - `C` (Column) — 소실점 방향으로 향하는 기둥 폴리곤 (`--c-thresh` 20° 이내) - `B` (Beam) — 수평 빔 폴리곤 (소실점 방향에서 크게 벗어남) - 판정 기준: B 1개 + 하단 C 2개 이상 → 門자형 라멘 ```bash # Step 1 python tools/detect_all_objects.py \ --input "data/역사구간/..." \ --categories configs/railway_zone.json \ --tiles all --cols 4 --rows 3 --overlap 0.10 --workers 2 # Step 2 python tools/detect_raamen.py \ --image "data/역사구간/.../image.JPG" \ --label "output/detect/image.json" \ --output "output/raamen/image_raamen.png" ``` --- ### 3. Everything 탐색 모드 문서화 `sam3_everything_explore.py` — Discovery Prompt (~20종 키워드)로 이미지 전체 객체를 타일 sweep, 라벨 빈도 집계. ```bash python tools/sam3_everything_explore.py \ --input "data/역사구간/.../image.JPG" \ --cols 8 --rows 6 --conf 0.10 --workers 4 ``` → 빈도 상위 라벨을 `railway_zone.json` 프롬프트 튜닝에 활용. --- ### 4. 문서 생성 `docs/railway-client-guide.html` — 다크테마 HTML 가이드 - 라멘 파이프라인 최우선 배치 - Everything 모드 상세 - 서버 설정·API 스키마 - 카테고리 15종 색상표 - 트러블슈팅 테이블
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kimminsung/railway-client#1