feat: OCR 新增沙特(SA)支持; 默认加入沙特

This commit is contained in:
yeuimu
2026-08-05 07:48:56 +00:00
parent 1739d47d59
commit 2128f17868
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -37,14 +37,14 @@ class OcrResult(BaseModel):
# OCR 服务已有分类器模型的国家(版面见 api.md §4) # OCR 服务已有分类器模型的国家(版面见 api.md §4)
SUPPORTED_COUNTRIES = {"US", "UK", "DE", "MX"} SUPPORTED_COUNTRIES = {"US", "UK", "DE", "MX", "SA"}
# ISO 国家代码 / 中文国名 → OCR 国家代码 # ISO 国家代码 / 中文国名 → OCR 国家代码
_COUNTRY_MAP: dict[str, str] = { _COUNTRY_MAP: dict[str, str] = {
# 代码 # 代码
"GB": "UK", "UK": "UK", "US": "US", "DE": "DE", "MX": "MX", "GB": "UK", "UK": "UK", "US": "US", "DE": "DE", "MX": "MX", "SA": "SA",
# 中文名(SDS countryName 可能用) # 中文名
"英国": "UK", "美国": "US", "德国": "DE", "墨西哥": "MX", "英国": "UK", "美国": "US", "德国": "DE", "墨西哥": "MX", "沙特": "SA",
} }
+1 -1
View File
@@ -124,7 +124,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}