feat: OCR 新增支持波兰(PL,版式 pables_dpd/pables_inpost)
CI / test (pull_request) Successful in 2m49s

This commit is contained in:
yeuimu
2026-10-15 03:12:21 +00:00
parent 489dacca49
commit fdcf107993
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -37,16 +37,16 @@ class OcrResult(BaseModel):
# OCR 服务已有分类器模型的国家(版面见 api.md §4) # OCR 服务已有分类器模型的国家(版面见 api.md §4)
SUPPORTED_COUNTRIES = {"US", "UK", "DE", "MX", "SA", "CA", "ES", "IT"} SUPPORTED_COUNTRIES = {"US", "UK", "DE", "MX", "SA", "CA", "ES", "IT", "PL"}
# ISO 国家代码 / 中文国名 → OCR 国家代码 # ISO 国家代码 / 中文国名 → OCR 国家代码
_COUNTRY_MAP: dict[str, str] = { _COUNTRY_MAP: dict[str, str] = {
# 代码 # 代码
"GB": "UK", "UK": "UK", "US": "US", "DE": "DE", "MX": "MX", "SA": "SA", "GB": "UK", "UK": "UK", "US": "US", "DE": "DE", "MX": "MX", "SA": "SA",
"CA": "CA", "ES": "ES", "IT": "IT", "CA": "CA", "ES": "ES", "IT": "IT", "PL": "PL",
# 中文名 # 中文名
"英国": "UK", "美国": "US", "德国": "DE", "墨西哥": "MX", "沙特": "SA", "英国": "UK", "美国": "US", "德国": "DE", "墨西哥": "MX", "沙特": "SA",
"加拿大": "CA", "西班牙": "ES", "意大利": "IT", "加拿大": "CA", "西班牙": "ES", "意大利": "IT", "波兰": "PL",
} }
+1 -1
View File
@@ -142,7 +142,7 @@ def label_ocr(
手动跑指定国家: label_ocr(country_regions=['德国']) 手动跑指定国家: label_ocr(country_regions=['德国'])
""" """
if country_regions is None: if country_regions is None:
country_regions = ['英国', '美国', '墨西哥', '德国', '沙特', '加拿大', '西班牙', '意大利'] country_regions = ['英国', '美国', '墨西哥', '德国', '沙特', '加拿大', '西班牙', '意大利', '波兰']
if _has_running_peer(): if _has_running_peer():
print("已有 label-ocr 在运行,跳过本次") print("已有 label-ocr 在运行,跳过本次")
return {"skipped": True} return {"skipped": True}