瀏覽代碼

feat(model_factory): add SmartLayoutRouter support for layout detection

- Integrated SmartLayoutRouter into ModelFactory for enhanced layout detection capabilities.
- This addition allows for the selection of the SmartLayoutRouter based on the specified module name, improving flexibility in model handling.
zhch158_admin 6 小時之前
父節點
當前提交
a29e289105
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      ocr_tools/universal_doc_parser/core/model_factory.py

+ 3 - 0
ocr_tools/universal_doc_parser/core/model_factory.py

@@ -48,6 +48,9 @@ class ModelFactory:
         elif module_name == 'mineru':
             from models.adapters import MinerULayoutDetector
             detector = MinerULayoutDetector(config)
+        elif module_name == 'smart_router':
+            from .layout_model_router import SmartLayoutRouter
+            detector = SmartLayoutRouter(config)
         else:
             raise ValueError(f"Unknown layout detector module: {module_name}")
         try: