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

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

생성 2026-09-01 22:36 · 집계 tune_t64

실측

사진
16
폴리곤
11,169
병합 후 폴리곤
6,370 (-43%)
라벨 종류
82 / 94
집합
12
검출 면적 / 화면
184.7%
집합 없는 폴리곤
120

미검출 — 무라벨 화면%

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

무라벨 평균
3.5%
무라벨 중앙
3.3%
최악
6.4%
5% 이하 사진
13 / 16
사진폴리곤무라벨%
DJI_20250805165320_05811,0796.4%
DJI_20250805163524_00079705.1%
DJI_20250805165516_06543635.0%
DJI_20250805163523_00069235.0%
DJI_20250805165514_06533774.7%
DJI_20250805163720_00794434.4%
DJI_20250805164537_03461,0203.6%
DJI_20250805164555_03579153.3%
DJI_20250805164932_04846063.0%
DJI_20250805164750_04218263.0%
DJI_20250805164304_02748732.9%
DJI_20250805164457_03217142.5%
DJI_20250805164931_04834892.5%
DJI_20250805164739_04145221.7%
DJI_20250805164917_04752871.5%
DJI_20250805164753_04237620.5%

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

SAM 검출 11,169 폴리곤(82 라벨)→ 집합 병합 →6,370 폴리곤(14 집합)· 사진 16장 기준

왼쪽 목록에서 라벨을 켜고 끈다. 휠 확대, 드래그 이동. 새 창: 1. SAM 검출 — 확정 설정 (16장) · 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완료
확정 설정 16장 검증
16장 실측 무라벨(conf 0.10): 최소 0.5%(0423) ~ 최대 6.4%(0581), 평균 3.44%. 15/16 장이 5% 이하. 같은 16장 기준선 평균 19.9%. 소요 466~907초/장(평균 585초). 예상이 틀린 곳: 물 많은 사진이 위험할 것으로 봤으나 0423 이 0.5% 로 최저였다 — water surface/reservoir 검출이 0이어도 다른 프롬프트가 그 면적을 덮는다.
M2대기
집합 정의 조정
튜닝 검출 결과(라벨 79종)를 보고 집합을 다시 짠다. 1차는 Claude, 이후 사용자.
M3대기
gap 값 조정
외곽선 인접 판정 1~3 px. 파일럿 기준 2 px 로 시작.

이슈 · 기각된 시도

해결
통짜(1×1) 패스는 대상 하나에 인스턴스가 하나만 남는다 — 도로 한쪽 차로, 논 한 필지만 잡힘. --wide-in-tiles 로 해결(측정치는 M1e).
미해결
0581 무라벨 6.4% — 16장 중 유일한 5% 초과. 원인 확인함: 큰 구멍이 없다. 구멍 1,554개 중 최대가 0.83%, 상위 6개 합이 2.15% 뿐이고 나머지 4.25%가 작은 조각 1,548개로 흩어져 있다. 자재 야적장·건물 밀집 구역이라 폴리곤이 1,079개 나왔는데도 객체 사이 얇은 틈이 누적된 것. 0654 유형(큰 필지 통째 누락)과 다르다. 프롬프트로는 못 줄인다 — 후처리(폴리곤 팽창·구멍 메우기) 영역.
미해결
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 / 73,03527.2%16.63% 1,76642%16.28%
building17 / 212,21819.9%15.18% 46679%12.97%
structure4 / 41,34712.1%0.46% 1,07920%0.57%
ground4 / 49398.4%7.71% 57339%9.09%
road6 / 78397.5%25.09% 24771%25.72%
fence4 / 57686.9%0.90% 7029%1.20%
vehicle13 / 146635.9%0.80% 57613%1.08%
stored material9 / 95364.8%0.75% 45016%1.03%
farmland7 / 84604.1%29.24% 15666%27.59%
없음2 / 21201.1%0.00% 1200%0.01%
retaining wall3 / 31000.9%0.28% 991%0.39%
slope2 / 4860.8%2.73% 851%3.79%
water5 / 6580.5%0.23% 5112%0.28%

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

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

프롬프트카테고리집합폴리곤사진면적%중앙 면적 px점수 중앙
buildingGeneral Categoriesbuilding160157.78%77,4770.446
building rooftopGeneral Categoriesbuilding159122.03%27,4860.198
building facadeGeneral Categoriesbuilding3680.32%67,3340.163
residential houseGeneral Categoriesbuilding0-0.00%00.000
warehouseGeneral Categoriesbuilding1580.13%91,4190.136
storage containerGeneral Categoriesbuilding8650.11%5,5930.159
factory structureGeneral Categoriesbuilding2491.04%232,9850.228
asphalt roadGeneral Categoriesroad148167.84%51,7960.261
concrete pavementGeneral Categoriesroad279167.28%50,8100.166
parking lotGeneral Categoriesroad79138.05%168,6940.443
pedestrian sidewalkGeneral Categoriesroad118161.10%61,3540.454
crosswalkGeneral Categoriesroad193120.67%7,3480.223
bare groundGeneral Categoriesground379161.44%11,5940.142
dirt fieldGeneral Categoriesground165154.13%58,3980.232
grass lawnGeneral Categoriesvegetation83162.14%52,8840.352
tree canopyGeneral Categoriesvegetation128161.67%55,4700.503
dense forestGeneral Categoriesvegetation29124.65%1,293,2220.782
green hedgeGeneral Categoriesvegetation252162.50%37,9350.256
crop fieldFarmlandfarmland1121512.62%361,1670.759
farmlandFarmlandfarmland77159.70%73,5230.134
plowed fieldFarmlandfarmland0-0.00%00.000
bare soil fieldFarmlandfarmland71121.01%21,6930.171
rice paddyFarmlandfarmland220.02%146,4950.115
vegetable fieldFarmlandfarmland53131.65%108,9240.297
blue roofRoofs & Structures by Colorbuilding194121.33%17,5200.592
red roofRoofs & Structures by Colorbuilding7370.05%2,9290.209
green roofRoofs & Structures by Colorbuilding51110.41%47,3520.742
gray roofRoofs & Structures by Colorbuilding130140.28%8,3400.207
dark gray roofRoofs & Structures by Colorbuilding106140.22%9,0170.227
black roofRoofs & Structures by Colorbuilding285140.24%4,4360.208
white roofRoofs & Structures by Colorbuilding590160.55%4,8310.244
silver metal roofRoofs & Structures by Colorbuilding212120.49%10,7400.182
orange roofRoofs & Structures by Colorbuilding3370.07%3,4070.189
brown roofRoofs & Structures by Colorbuilding60130.12%10,0860.212
yellow roofRoofs & Structures by Colorbuilding420.00%10,6100.154
white vehicleVehicles & Transportation by Colorvehicle237160.34%16,9160.762
black vehicleVehicles & Transportation by Colorvehicle203150.18%5,6440.187
silver vehicleVehicles & Transportation by Colorvehicle25140.03%14,4520.881
gray vehicleVehicles & Transportation by Colorvehicle33130.05%20,1540.804
red vehicleVehicles & Transportation by Colorvehicle48110.04%6,0410.233
blue vehicleVehicles & Transportation by Colorvehicle28110.02%3,7880.238
yellow vehicleVehicles & Transportation by Colorvehicle1790.01%6,3140.319
orange vehicleVehicles & Transportation by Colorvehicle25100.02%6,2820.230
green vehicleVehicles & Transportation by Colorvehicle850.01%7,0890.368
white cargo truckVehicles & Transportation by Colorvehicle2760.09%41,4780.889
blue cargo truckVehicles & Transportation by Colorvehicle220.01%33,1560.821
commercial busVehicles & Transportation by Colorvehicle0-0.00%00.000
tractorVehicles & Transportation by Colorvehicle320.00%21,9010.165
excavatorVehicles & Transportation by Colorvehicle760.01%14,1720.486
blue plastic drumIndustrial Materials, Storage & Objects by Colorstored material2260.02%1,3960.142
orange plastic barrelIndustrial Materials, Storage & Objects by Colorstored material5390.01%1,4050.145
yellow plastic containerIndustrial Materials, Storage & Objects by Colorstored material123120.03%1,6200.215
white industrial tankIndustrial Materials, Storage & Objects by Colorstored material4260.02%2,4060.157
metallic storage tankIndustrial Materials, Storage & Objects by Colorstored material110.00%38,9080.245
blue waterproof tarpIndustrial Materials, Storage & Objects by Colorstored material11190.15%7,9700.354
green waterproof tarpIndustrial Materials, Storage & Objects by Colorstored material6580.30%7,2040.324
black protective sheetIndustrial Materials, Storage & Objects by Colorstored material5590.13%11,0980.180
white canvas canopyIndustrial Materials, Storage & Objects by Colorstored material64110.09%4,8940.217
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 Colorfence46140.06%9,7640.168
green wire fenceIndustrial Materials, Storage & Objects by Colorfence0-0.00%00.000
red roadside barrierIndustrial Materials, Storage & Objects by Colorfence1720.00%7420.142
yellow safety coneIndustrial Materials, Storage & Objects by Color없음640.00%1,6760.296
orange traffic coneIndustrial Materials, Storage & Objects by Color없음11480.00%3040.142
retaining wallRoad Infrastructureretaining wall630.08%147,9610.334
concrete retaining wallRoad Infrastructureretaining wall92140.19%14,3160.169
gabion wallRoad Infrastructureretaining wall220.01%47,6820.684
guardrailRoad Infrastructurefence47130.09%18,2920.204
metal guardrailRoad Infrastructurefence658160.75%5,7260.170
road embankment slopeRoad Infrastructureslope0-0.00%00.000
cut slopeRoad Infrastructureslope2590.29%59,9220.141
riprap slopeRoad Infrastructureslope0-0.00%00.000
bridgeRoad Infrastructureroad0-0.00%00.000
culvertRoad Infrastructurestructure930.00%1,1960.105
utility poleRoad Infrastructurestructure608160.23%1,6680.201
streetlight poleRoad Infrastructurestructure372160.09%1,8180.220
road signRoad Infrastructurestructure358160.14%2,3050.221
water surfaceWaterwater0-0.00%00.000
pondWaterwater940.06%49,9090.458
reservoirWaterwater110.03%433,3740.395
streamWaterwater2060.09%38,4960.351
irrigation canalWaterwater2260.05%18,0650.201
drainage ditchWaterwater650.01%6,3520.143
overgrown weedsBoundary & Fillervegetation1,190162.73%4,3060.172
shrubBoundary & Fillervegetation1,353162.94%6,4330.206
grass covered embankmentBoundary & Fillerslope61112.44%156,7370.446
earth bankBoundary & Fillerground630.01%4,6430.115
dirt pathBoundary & Fillerground389162.13%23,0840.246
ripening rice fieldRipening & Bare Fieldfarmland27103.87%1,393,1400.958
yellow grass fieldRipening & Bare Fieldvegetation0-0.00%00.000
harvested fieldRipening & Bare Fieldfarmland118140.36%15,1270.139
gravel shoulderRipening & Bare Fieldroad22120.16%55,6260.159

설정

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