MCPcopy Create free account
hub / github.com/BIT-DataLab/Edit-Banana / __init__

Method __init__

modules/sam3_info_extractor.py:372–386  ·  view source on GitHub ↗
(self, config=None, checkpoint_path: str = None, bpe_path: str = None)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 5

get_prompt_groupsMethod · 0.80
get_text_filterMethod · 0.80
get_sam3_configMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected