简化的图标检测接口 Args: image: 目标图像 icon_names: 图标名称列表 app_id: 应用ID threshold: 相似度阈值 match_mode: 匹配模式 ('any' 或 'all') Returns: 检测是否成功
(image: Union[np.ndarray, str],
icon_names: List[str],
app_id: Optional[str] = None,
threshold: Optional[float] = None,
match_mode: str = 'any')
| 565 | |
| 566 | |
| 567 | def detect_icons_simple(image: Union[np.ndarray, str], |
| 568 | icon_names: List[str], |
| 569 | app_id: Optional[str] = None, |
| 570 | threshold: Optional[float] = None, |
| 571 | match_mode: str = 'any') -> bool: |
| 572 | """ |
| 573 | 简化的图标检测接口 |
| 574 | |
| 575 | Args: |
| 576 | image: 目标图像 |
| 577 | icon_names: 图标名称列表 |
| 578 | app_id: 应用ID |
| 579 | threshold: 相似度阈值 |
| 580 | match_mode: 匹配模式 ('any' 或 'all') |
| 581 | |
| 582 | Returns: |
| 583 | 检测是否成功 |
| 584 | """ |
| 585 | service = get_icon_detection_service() |
| 586 | result = service.detect_icons(image, icon_names, app_id, threshold, match_mode) |
| 587 | return result['success'] |
| 588 | |
| 589 | |
| 590 | def detect_single_icon(image: Union[np.ndarray, str], |
no test coverage detected