feat: no padding image
This commit is contained in:
@@ -45,15 +45,15 @@ class Settings(BaseSettings):
|
||||
return f"http://{self.base_host}:8002/v1"
|
||||
|
||||
# padding ratio
|
||||
is_padding: bool = True
|
||||
padding_ratio: float = 0.15
|
||||
is_padding: bool = False
|
||||
padding_ratio: float = 0.1
|
||||
|
||||
# Model Paths
|
||||
pp_doclayout_model_dir: Optional[str] = "/home/yoge/.cache/modelscope/hub/models/PaddlePaddle/PP-DocLayoutV3"
|
||||
|
||||
# Image Processing
|
||||
max_image_size_mb: int = 10
|
||||
image_padding_ratio: float = 0.15 # 15% on each side = 30% total expansion
|
||||
image_padding_ratio: float = 0.1 # 10% on each side = 20% total expansion
|
||||
|
||||
device: torch.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # cuda:0 or cpu
|
||||
|
||||
|
||||
@@ -668,7 +668,7 @@ class MineruOCRService(OCRServiceBase):
|
||||
if formula_text.startswith(r"\[") or formula_text.startswith(r"\("):
|
||||
formula_text = formula_text.replace(r"\[", "$$").replace(r"\(", "$$")
|
||||
formula_text = formula_text.replace(r"\]", "$$").replace(r"\)", "$$")
|
||||
else:
|
||||
elif not formula_text.startswith("$$") and not formula_text.startswith("$"):
|
||||
formula_text = f"$${formula_text}$$"
|
||||
|
||||
return formula_text
|
||||
|
||||
Reference in New Issue
Block a user