fix: get setting param
This commit is contained in:
@@ -30,8 +30,12 @@ class Settings(BaseSettings):
|
|||||||
# GLM OCR Settings
|
# GLM OCR Settings
|
||||||
glm_ocr_url: str = "http://127.0.0.1:8002/v1"
|
glm_ocr_url: str = "http://127.0.0.1:8002/v1"
|
||||||
|
|
||||||
|
# padding ratio
|
||||||
|
is_padding: bool = False
|
||||||
|
padding_ratio: float = 0.15
|
||||||
|
|
||||||
# Model Paths
|
# Model Paths
|
||||||
pp_doclayout_model_dir: Optional[str] = "/home/yoge/.cache/modelscope/hub/models/PaddlePaddle/PP-DocLayoutV2"
|
pp_doclayout_model_dir: Optional[str] = "/home/yoge/.cache/modelscope/hub/models/PaddlePaddle/PP-DocLayoutV3"
|
||||||
|
|
||||||
# Image Processing
|
# Image Processing
|
||||||
max_image_size_mb: int = 10
|
max_image_size_mb: int = 10
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ class MineruOCRService(OCRServiceBase):
|
|||||||
Dict with 'markdown', 'latex', 'mathml' keys.
|
Dict with 'markdown', 'latex', 'mathml' keys.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if self.image_processor and get_settings().is_padding:
|
if self.image_processor and settings.is_padding:
|
||||||
image = self.image_processor.add_padding(image)
|
image = self.image_processor.add_padding(image)
|
||||||
|
|
||||||
# Convert numpy array to image bytes
|
# Convert numpy array to image bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user