SAM 3.1 후처리 — 검출 커버리지 · 집합 병합

1단계는 미검출을 없애는 것이다. 지표는 '무라벨 화면%' — 마스크 합집합으로 재서 겹침을 뺀 값. 목표 5% 이하, 8장 평균 3.6% 로 달성. 2단계는 집합으로 묶고 외곽선이 gap px 이내로 인접한 폴리곤을 합치는 것.

생성 2026-09-01 18:49 · 집계 tune_t64

실측

사진
8
폴리곤
4,586
병합 후 폴리곤
2,636 (-43%)
라벨 종류
79 / 94
집합
12
검출 면적 / 화면
182.1%
집합 없는 폴리곤
50

미검출 — 무라벨 화면%

마스크 합집합 기준(겹침 제거), 축척 1/4. 목표 5% 이하.

무라벨 평균
3.6%
무라벨 중앙
4.4%
최악
5.0%
5% 이하 사진
7 / 8
사진폴리곤무라벨%
DJI_20250805165516_06543635.0%
DJI_20250805163523_00069235.0%
DJI_20250805165514_06533774.7%
DJI_20250805163720_00794434.4%
DJI_20250805164932_04846063.0%
DJI_20250805164304_02748732.9%
DJI_20250805164457_03217142.5%
DJI_20250805164917_04752871.5%

공정 보기 — 같은 사진, 단계별

SAM 검출 4,586 폴리곤(79 라벨)→ 집합 병합 →2,636 폴리곤(14 집합)· 사진 8장 기준

왼쪽 목록에서 라벨을 켜고 끈다. 휠 확대, 드래그 이동. 새 창: 1. SAM 검출 — 확정 설정 · 2. 집합 병합 후 (gap 2px) · 참고: 기준선 검출 (conf 0.25, 4×3)

단계

M1완료
프롬프트별 검출 집계
tools/prompt_stats.py. YYX_run 실측: 폴리곤 13,580 · 라벨 77종.
M1b완료
공정 보기(검출 → 병합) 뷰어 연결
tools/make_viewer.py 로 같은 사진 3장을 단계별로 굽고 모니터에 붙였다. docs/pilot/theater/.
M1c완료
무라벨 지표 확립
tools/coverage_stats.py. YYX_run 69장 실측: 무라벨 평균 16.1% · 중앙 15.0% · 최악 52.1%(0654). 덮음 95% 이상은 2장뿐.
M1d완료
통짜 패스 원인 규명
wide_v1.txt 의 21개(asphalt road, crop field, farmland, tree canopy 등)는 8192×5460 을 1×1 로 넣어 대상당 인스턴스가 1개만 살아남았다. 0006 에서 asphalt road 가 서쪽 차로만 덮음(1개, score 0.910).
M1e완료
--wide-in-tiles 시험
통짜 프롬프트를 타일 패스에도 돌린다. 0654 무라벨 52.1→15.4%, 0006 19.4→12.2%. 비용 140→231초/장 (+65%).
M1f완료
경계 띠 프롬프트 추가 (v3)
잔여 무라벨이 논밭 둑·도로 법면·밭 가장자리 잡초였다. overgrown weeds / shrub / grass covered embankment / earth bank / dirt path 5개 추가. 효과 작음 — 0654 15.4→14.9%, 0006 12.2→11.9%.
M1g완료
conf 스윕
conf 0.10 으로 한 번 뽑고 점수 문턱을 오프라인으로 쓸었다. 0006: 0.25에서 9.3% → 0.10에서 5.8%. 0654: 13.1% → 9.5%. conf 0.03 은 마스크 폭증으로 37분에 1장도 못 끝내 중단.
M1h완료
v4 프롬프트 (익은 논·갓길)
ripening rice field / yellow grass field / harvested field / gravel shoulder 추가. 효과 없음 — 0006 5.8→5.7%, 0654 9.5→9.6%. 프롬프트 추가는 포화.
M1i완료
타일 4×3 → 6×4 (목표 달성)
conf 0.10 · v4 프롬프트 · --wide-in-tiles 와 함께. 4장 실측 무라벨: 0654 5.0% (기준선 52.1) · 0484 3.0% (38.7) · 0079 4.4% (27.1) · 0006 5.0% (19.4). 평균 34.3% → 4.35%. 비용 466~616초/장, 평균 523초 = 기준선 140초의 3.7배. 69장 재검출 시 약 10시간.
M1j완료
확정 설정 8장 검증
8장 실측 무라벨(conf 0.10): 0654 5.0 · 0006 5.0 · 0653 4.7 · 0079 4.4 · 0484 3.0 · 0274 2.9 · 0321 2.5 · 0475 1.5 → 평균 3.6%. 같은 8장 기준선은 평균 21.8%. 소요 466~662초/장(평균 548초). 중간에 PC 다운으로 2장 유실, 재개함.
M2대기
집합 정의 조정
튜닝 검출 결과(라벨 79종)를 보고 집합을 다시 짠다. 1차는 Claude, 이후 사용자.
M3대기
gap 값 조정
외곽선 인접 판정 1~3 px. 파일럿 기준 2 px 로 시작.

이슈 · 기각된 시도

해결
통짜(1×1) 패스는 대상 하나에 인스턴스가 하나만 남는다 — 도로 한쪽 차로, 논 한 필지만 잡힘. --wide-in-tiles 로 해결(측정치는 M1e).
미해결
orange traffic cone / yellow safety cone 은 어느 집합에도 없어 검출 52 폴리곤이 버려진다. [cone] 그룹이 주석 처리돼 있음 — 나란히 놓인 콘이 한 덩어리로 융합된다는 이유.
미해결
검출 0 인 프롬프트 8개 (plowed field, rice paddy, vinyl greenhouse tunnel, gabion wall, road embankment slope, riprap slope, water surface, reservoir) — 유지할지 뺄지 미정.
기각
프롬프트 색 특정성 A/B (car/sedan/suv/van/pickup truck) — 폴리곤 +26% 인데 마스크 면적은 +0.002~0.068%p 뿐, 신규 마스크의 90~99%가 기존과 겹침.
기각
정사영상으로 차량 검증 — 경사 사진(2025-08-05)과 정사영상(250922)이 다른 비행이라 주차 차량 위치가 다르다.

집합별 합계

집합프롬프트(검출>0/전체)폴리곤폴리곤%면적% 병합 후 폴리곤줄어든 비율병합 후 면적%
vegetation6 / 71,33629.1%19.27% 77142%19.04%
building17 / 2173216.0%11.27% 15779%9.58%
structure4 / 458912.8%0.48% 46421%0.61%
ground4 / 44399.6%6.62% 25741%7.55%
road6 / 73938.6%18.45% 10673%18.76%
fence4 / 53156.9%0.76% 2869%1.02%
vehicle12 / 142174.7%0.51% 18913%0.70%
stored material8 / 92054.5%0.82% 16818%1.14%
farmland7 / 81964.3%38.33% 7562%36.63%
slope2 / 4541.2%3.25% 540%4.62%
없음2 / 2501.1%0.00% 500%0.01%
retaining wall3 / 3420.9%0.17% 412%0.23%
water4 / 6180.4%0.08% 180%0.11%

병합 후 면적%는 병합 후 총검출면적 기준. 겹침을 빼지 않은 다각형 넓이 합이다.

카테고리 · 프롬프트별 검출

프롬프트카테고리집합폴리곤사진면적%중앙 면적 px점수 중앙
buildingGeneral Categoriesbuilding5075.99%69,0360.567
building rooftopGeneral Categoriesbuilding6251.55%19,6790.176
building facadeGeneral Categoriesbuilding1130.22%71,3900.198
residential houseGeneral Categoriesbuilding0-0.00%00.000
warehouseGeneral Categoriesbuilding530.04%58,3280.135
storage containerGeneral Categoriesbuilding310.02%16,4360.138
factory structureGeneral Categoriesbuilding840.63%148,2680.182
asphalt roadGeneral Categoriesroad7287.11%48,3420.307
concrete pavementGeneral Categoriesroad12986.13%73,5740.165
parking lotGeneral Categoriesroad3263.54%165,5760.412
pedestrian sidewalkGeneral Categoriesroad5680.99%58,7560.410
crosswalkGeneral Categoriesroad9570.57%4,8140.193
bare groundGeneral Categoriesground15681.59%16,7800.147
dirt fieldGeneral Categoriesground7872.69%49,0510.220
grass lawnGeneral Categoriesvegetation3081.61%56,9420.452
tree canopyGeneral Categoriesvegetation7482.08%55,6900.553
dense forestGeneral Categoriesvegetation1777.30%2,051,8200.880
green hedgeGeneral Categoriesvegetation9782.24%41,9630.264
crop fieldFarmlandfarmland57716.71%603,9500.844
farmlandFarmlandfarmland33713.18%92,8050.141
plowed fieldFarmlandfarmland0-0.00%00.000
bare soil fieldFarmlandfarmland3061.32%56,6410.175
rice paddyFarmlandfarmland110.01%95,9060.120
vegetable fieldFarmlandfarmland1760.77%93,2520.316
blue roofRoofs & Structures by Colorbuilding6361.03%18,0580.653
red roofRoofs & Structures by Colorbuilding1520.04%2,6230.168
green roofRoofs & Structures by Colorbuilding1750.31%63,9920.814
gray roofRoofs & Structures by Colorbuilding4770.23%8,5480.203
dark gray roofRoofs & Structures by Colorbuilding4670.23%10,4210.249
black roofRoofs & Structures by Colorbuilding10560.13%3,8300.225
white roofRoofs & Structures by Colorbuilding20980.34%4,6000.246
silver metal roofRoofs & Structures by Colorbuilding6650.37%16,1700.164
orange roofRoofs & Structures by Colorbuilding430.00%5,9930.161
brown roofRoofs & Structures by Colorbuilding1860.14%20,3970.444
yellow roofRoofs & Structures by Colorbuilding310.01%19,5040.168
white vehicleVehicles & Transportation by Colorvehicle7080.20%16,2850.829
black vehicleVehicles & Transportation by Colorvehicle7070.13%6,9480.225
silver vehicleVehicles & Transportation by Colorvehicle1060.02%15,0460.892
gray vehicleVehicles & Transportation by Colorvehicle1160.04%22,7870.822
red vehicleVehicles & Transportation by Colorvehicle1160.01%4,6670.243
blue vehicleVehicles & Transportation by Colorvehicle950.01%3,2530.245
yellow vehicleVehicles & Transportation by Colorvehicle210.00%7,7460.209
orange vehicleVehicles & Transportation by Colorvehicle1550.02%4,6920.230
green vehicleVehicles & Transportation by Colorvehicle520.01%3,6820.330
white cargo truckVehicles & Transportation by Colorvehicle720.04%32,1350.889
blue cargo truckVehicles & Transportation by Colorvehicle220.01%33,1560.821
commercial busVehicles & Transportation by Colorvehicle0-0.00%00.000
tractorVehicles & Transportation by Colorvehicle0-0.00%00.000
excavatorVehicles & Transportation by Colorvehicle540.02%16,7930.653
blue plastic drumIndustrial Materials, Storage & Objects by Colorstored material220.00%1,2930.171
orange plastic barrelIndustrial Materials, Storage & Objects by Colorstored material2330.01%9060.138
yellow plastic containerIndustrial Materials, Storage & Objects by Colorstored material4460.02%1,7980.274
white industrial tankIndustrial Materials, Storage & Objects by Colorstored material2820.01%1,6440.137
metallic storage tankIndustrial Materials, Storage & Objects by Colorstored material0-0.00%00.000
blue waterproof tarpIndustrial Materials, Storage & Objects by Colorstored material5850.17%7,3920.319
green waterproof tarpIndustrial Materials, Storage & Objects by Colorstored material1940.52%12,5320.454
black protective sheetIndustrial Materials, Storage & Objects by Colorstored material1340.03%12,4310.156
white canvas canopyIndustrial Materials, Storage & Objects by Colorstored material1850.06%5,4920.255
plastic greenhouseIndustrial Materials, Storage & Objects by Colorbuilding0-0.00%00.000
vinyl greenhouse tunnelIndustrial Materials, Storage & Objects by Colorbuilding0-0.00%00.000
greenhouse roofIndustrial Materials, Storage & Objects by Colorbuilding0-0.00%00.000
gray metal fenceIndustrial Materials, Storage & Objects by Colorfence1960.05%8,5740.226
green wire fenceIndustrial Materials, Storage & Objects by Colorfence0-0.00%00.000
red roadside barrierIndustrial Materials, Storage & Objects by Colorfence710.00%1,0400.154
yellow safety coneIndustrial Materials, Storage & Objects by Color없음530.00%1,9480.354
orange traffic coneIndustrial Materials, Storage & Objects by Color없음4530.00%2940.123
retaining wallRoad Infrastructureretaining wall210.01%22,4140.288
concrete retaining wallRoad Infrastructureretaining wall3880.15%15,7860.169
gabion wallRoad Infrastructureretaining wall220.01%47,6820.684
guardrailRoad Infrastructurefence2780.08%15,0650.285
metal guardrailRoad Infrastructurefence26280.62%5,7900.179
road embankment slopeRoad Infrastructureslope0-0.00%00.000
cut slopeRoad Infrastructureslope1960.51%62,1660.146
riprap slopeRoad Infrastructureslope0-0.00%00.000
bridgeRoad Infrastructureroad0-0.00%00.000
culvertRoad Infrastructurestructure520.00%1,0270.107
utility poleRoad Infrastructurestructure29880.28%1,9920.212
streetlight poleRoad Infrastructurestructure15880.07%1,6810.242
road signRoad Infrastructurestructure12880.14%2,5310.247
water surfaceWaterwater0-0.00%00.000
pondWaterwater110.00%13,3090.726
reservoirWaterwater0-0.00%00.000
streamWaterwater830.05%28,4980.333
irrigation canalWaterwater420.02%27,3930.304
drainage ditchWaterwater540.01%4,6540.144
overgrown weedsBoundary & Fillervegetation53182.66%4,3210.167
shrubBoundary & Fillervegetation58783.37%6,5840.198
grass covered embankmentBoundary & Fillerslope3562.74%166,6030.422
earth bankBoundary & Fillerground420.00%4,5050.145
dirt pathBoundary & Fillerground20182.33%25,3540.254
ripening rice fieldRipening & Bare Fieldfarmland2056.08%1,491,0180.957
yellow grass fieldRipening & Bare Fieldvegetation0-0.00%00.000
harvested fieldRipening & Bare Fieldfarmland3860.27%20,7050.136
gravel shoulderRipening & Bare Fieldroad960.12%50,5880.179

설정

gap_px2 epsilon_px1.5 기준 런output/sam3/tune_t64 (확정 설정 8장) / 기준선은 output/sam3/YYX_run 69장 프롬프트 파일prompts/discovery_v4.txt (94개). 기준선은 discovery_v1.txt (85개) 집합 정의configs/merge_groups_v4.txt (12집합). 기준선은 merge_groups.txt 타일6×4 = 24개, overlap 10%, 타일 크기 1365×1365. 기준선은 4×3 (2048×1820) 검출 설정conf 0.10 · NMS iou 0.40 · 같은 라벨 병합 gap 8px · --wide-in-tiles. 기준선 conf 0.25, 통짜 분리 공정 보기 사진확정 설정 8장 (기준선 무라벨 3.5~52.1% 분포에서 고름) 확정 후보 설정prompts/discovery_v4.txt (94개) · configs/merge_groups_v4.txt · --wide-in-tiles · --cols 6 --rows 4 · --conf 0.10 · NMS 0.40 · --merge (gap 8px) · 병합 gap 2px