공공기관2 작업 중. _temp 몽타주(재생성가능)는 제외. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# 현재 N vs 몽타주 det 대조 + 한칸밀림 검사(N[r] == det[r-1] 패턴?)
|
|
import openpyxl, json, io, sys
|
|
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
|
|
F=r'D:\01.프로젝트\DB수집\작업파일\광역_사이트맵\충청남도\13.청양군\충청남도_청양군.xlsx'
|
|
wb=openpyxl.load_workbook(F); ws=wb.active
|
|
j=json.load(open('_cy2_123.json',encoding='utf-8'))
|
|
def lab(r): return str(ws.cell(r,7).value or ws.cell(r,6).value or ws.cell(r,5).value or '')[:16]
|
|
# 후보(이미지 가능)행만: json det에 이미지 들어간 행
|
|
img_rows=[int(r) for r,v in j.items() if v.get('det') and '이미지' in v['det']]
|
|
img_rows.sort()
|
|
print('몽타주 이미지후보',len(img_rows),'행')
|
|
same=off=0
|
|
print('=== 이미지후보행: row label | json_det | 현재N | 라벨일치 ===')
|
|
for r in img_rows:
|
|
cl=lab(r); jl=str(j[str(r)].get('label') or '')[:16]
|
|
labok = cl==jl
|
|
n=ws.cell(r,14).value
|
|
flag=''
|
|
if not labok: flag+=' [라벨불일치 json=%s]'%jl
|
|
print('r%d %-16s | %-12s | %-12s%s'%(r,cl,j[str(r)]['det'],n,flag))
|