(self, config=None, checkpoint_path: str = None, bpe_path: str = None)
| 370 | """Extract diagram elements via SAM3; prompt groups and thresholds from config.""" |
| 371 | |
| 372 | def __init__(self, config=None, checkpoint_path: str = None, bpe_path: str = None): |
| 373 | super().__init__(config) |
| 374 | |
| 375 | # 从配置文件加载词组(不再硬编码) |
| 376 | self.prompt_groups = ConfigLoader.get_prompt_groups() |
| 377 | self.text_filter = ConfigLoader.get_text_filter() |
| 378 | self.dedup_config = ConfigLoader.get_deduplication_config() |
| 379 | |
| 380 | # 加载SAM3模型配置 |
| 381 | sam3_config = ConfigLoader.get_sam3_config() |
| 382 | self._checkpoint_path = checkpoint_path or sam3_config.get('checkpoint_path', '') |
| 383 | self._bpe_path = bpe_path or sam3_config.get('bpe_path', '') |
| 384 | |
| 385 | self._sam3_model: Optional[SAM3Model] = None |
| 386 | self._current_image_path: Optional[str] = None |
| 387 | |
| 388 | def reload_config(self): |
| 389 | """Reload config from disk.""" |
nothing calls this directly
no test coverage detected