|
|
@@ -1,5 +1,11 @@
|
|
|
"""模型工厂 - 根据配置创建模型实例"""
|
|
|
from typing import Dict, Any, Optional
|
|
|
+import sys
|
|
|
+from pathlib import Path
|
|
|
+# 添加项目根目录到路径
|
|
|
+project_root = Path(__file__).parents[1]
|
|
|
+if str(project_root) not in sys.path:
|
|
|
+ sys.path.insert(0, str(project_root))
|
|
|
from models.adapters import BasePreprocessor, BaseLayoutDetector, BaseVLRecognizer, BaseOCRRecognizer
|
|
|
|
|
|
class ModelFactory:
|