Skip to content

Add change_localize: attribute a screen change to the element boxes that changed#447

Merged
JE-Chen merged 1 commit into
devfrom
feat/change-localize-batch
Jun 26, 2026
Merged

Add change_localize: attribute a screen change to the element boxes that changed#447
JE-Chen merged 1 commit into
devfrom
feat/change-localize-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Summary

Fifth feature of the ROUND-15 perception lane. Existing diffs return raw pixel regions (motion_regions, perceptual_diff, ssim_changed_regions) or a11y-element diffs (element_diff); the gap is "given a frame diff and a list of element boxes, which of those changed?".

  • Headless core utils/change_localize/: localize_changes (diff reference vs current/screen, score each supplied element box by its mean per-pixel change 0..1, rank), rank_changes (pure ranker — flags changed when score ≥ threshold, sorts most-changed first). Pairs with set_of_marks/accessibility boxes for a per-element "what changed" feedback signal after a click. cv2/numpy imported lazily; loaders reuse visual_match.
  • 5 layers wired: facade __all__; AC_localize_changes (device) + AC_rank_changes (pure) executor commands; matching read-only ac_* MCP tools; Script Builder under Image.
  • Docs: EN + Zh v218_features_doc.rst + WHATS_NEW.md.

Test

test/unit_test/headless/test_change_localize_batch.py — pure rank (marks+sorts, tuple inputs, empty, threshold boundary), cv2 localize_changes attributes a change to the right box (importorskip); wiring + facade run cv2-free. All 8 green; ruff + bandit + radon clean; pytest.approx (no float ==); package stays Qt-free.

…hat changed

Existing diffs return raw pixel regions or a11y-element diffs; the gap is
'given a frame diff and a list of element boxes, which of those changed?'.
localize_changes diffs reference vs current and scores each element box by
its mean per-pixel change; rank_changes is the pure ranker (changed when
score >= threshold, sorted most-changed first). cv2/numpy lazy.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 27 complexity · 0 duplication

Metric Results
Complexity 27
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 3bfc506 into dev Jun 26, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/change-localize-batch branch June 26, 2026 02:01
@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