|
@@ -115,6 +115,14 @@ class ModelFactory:
|
|
|
raise ValueError(f"Unknown table classifier module: {module_name}")
|
|
raise ValueError(f"Unknown table classifier module: {module_name}")
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
|
|
|
+ def create_seal_ocr_recognizer(cls, config: Dict[str, Any]):
|
|
|
|
|
+ """创建印章 OCR 识别器(基于 MinerU PytorchPaddleOCR lang=seal)"""
|
|
|
|
|
+ from models.adapters import SealOCRRecognizer
|
|
|
|
|
+ recognizer = SealOCRRecognizer(config)
|
|
|
|
|
+ recognizer.initialize()
|
|
|
|
|
+ return recognizer
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
def cleanup_all(cls):
|
|
def cleanup_all(cls):
|
|
|
"""清理所有模型资源"""
|
|
"""清理所有模型资源"""
|
|
|
# 在实际应用中,可以维护一个活跃模型列表进行清理
|
|
# 在实际应用中,可以维护一个活跃模型列表进行清理
|