Skip to content

Add match_ensemble: multi-template consensus matching#393

Merged
JE-Chen merged 1 commit into
devfrom
feat/match-ensemble-batch
Jun 23, 2026
Merged

Add match_ensemble: multi-template consensus matching#393
JE-Chen merged 1 commit into
devfrom
feat/match-ensemble-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

摘要

新增 match_ensemble / vote_centers — 把同一目標的多個參考裁切投票成單一可信位置。一個按鈕常以多種狀態呈現(預設/懸停/按下/停用)但是單一邏輯目標;ab_locator A/B 測哪個單一策略勝出、match_template(scales=...) 跨縮放掃一個模板——兩者都不把多參考融合成一次投票。

本功能比對每個參考,聚類命中中心,只有在至少 min_votes 個參考於 agree_px 內一致時才接受目標,回傳 {point, votes, n_candidates, spread}——大幅減少換膚/動畫 UI 的誤判。投票核心 vote_centers 為純標準函式庫並重用 grounding_consensus 聚類(可無影像測試);只有 match_ensemble 呼叫 visual_match.match_template(可於注入合成 haystack 測試)。Qt-free。

五層

  • 核心:utils/match_ensemble/match_ensemblevote_centers
  • Facade / Executor AC_match_ensemble + AC_vote_centers / MCP ac_match_ensemble + ac_vote_centers / Script Builder(Image)。
  • 文件:v178 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test_match_ensemble_batch.py — vote_centers 多數一致 + votes/n、票數不足→None、空→None、注入 haystack 三參考共識、wiring + facade。6 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。

A button renders in several states (default/hover/pressed) but is one logical
target; ab_locator picks one strategy and match_template(scales=) sweeps one
template - neither fuses multiple references. Match each reference, cluster the
hit centres, and accept only when >= min_votes agree within agree_px, returning
the consensus point. Reuses visual_match.match_template + grounding_consensus;
vote_centers is the pure voting core.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 15 complexity · 0 duplication

Metric Results
Complexity 15
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 5b4eb97 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/match-ensemble-batch branch June 23, 2026 23:10
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant