This commit is contained in:
HuangHai
2026-01-28 07:31:28 +08:00
parent efcef1bade
commit d2fc0cd7c7
13 changed files with 336 additions and 271 deletions

View File

@@ -34,7 +34,6 @@ NON_STATION_KEYWORDS = [
"充电券",
"电信积分兑换",
"确认",
"广告",
"距离/区域",
"综合排序",
"偏好",
@@ -47,6 +46,7 @@ NON_STATION_KEYWORDS = [
"输入",
"商城",
"推荐",
"新客专享",
]
def _load_image(path):
@@ -140,11 +140,17 @@ async def run_ocr_rect(image_path, log_path=None):
status = "drop"
reasons.append("bottom_safe_zone")
if status == "keep" and txt:
for kw in NON_STATION_KEYWORDS:
if kw and kw in txt:
status = "drop"
reasons.append("non_station_keyword")
break
# Prevent filter bar items from being treated as stations
if txt.strip() in ["充电站", "快充", "慢充", "超快充", "广告"]:
status = "drop"
reasons.append("exact_filter_keyword")
if status == "keep":
for kw in NON_STATION_KEYWORDS:
if kw and kw in txt:
status = "drop"
reasons.append("non_station_keyword")
break
log_detail(
f"OCR[{idx + 1}] text={repr(text)} prob={prob:.3f} "