feat: add padding

This commit is contained in:
liuyuanchuang
2026-02-07 16:53:09 +08:00
parent d86107976a
commit f514f98142
3 changed files with 50 additions and 21 deletions

View File

@@ -21,17 +21,31 @@ class Settings(BaseSettings):
api_prefix: str = "/doc_process/v1"
debug: bool = False
# Base Host Settings (can be overridden via .env file)
# Default: 127.0.0.1 (production)
# Dev: Set BASE_HOST=100.115.184.74 in .env file
base_host: str = "127.0.0.1"
# PaddleOCR-VL Settings
paddleocr_vl_url: str = "http://127.0.0.1:8001/v1"
@property
def paddleocr_vl_url(self) -> str:
"""Get PaddleOCR-VL URL based on base_host."""
return f"http://{self.base_host}:8001/v1"
# MinerOCR Settings
miner_ocr_api_url: str = "http://127.0.0.1:8000/file_parse"
@property
def miner_ocr_api_url(self) -> str:
"""Get MinerOCR API URL based on base_host."""
return f"http://{self.base_host}:8000/file_parse"
# GLM OCR Settings
glm_ocr_url: str = "http://127.0.0.1:8002/v1"
@property
def glm_ocr_url(self) -> str:
"""Get GLM OCR URL based on base_host."""
return f"http://{self.base_host}:8002/v1"
# padding ratio
is_padding: bool = False
is_padding: bool = True
padding_ratio: float = 0.15
# Model Paths