Skip to content

feat(grounding): add Meta SAM 3.1 visual UI grounding (nerve_ground + nerve_tap prompt) - #1

Closed
andreBurnt wants to merge 1 commit into
mainfrom
hackathon/muse-sam
Closed

andreBurnt wants to merge 1 commit into
mainfrom
hackathon/muse-sam

Conversation

@andreBurnt

@andreBurnt andreBurnt commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary (Meta Global AI Developer Hackathon — Oct 26–Nov 4, 2026)

Adds Meta SAM 3.1 Promptable Concept Segmentation (POST https://api.meta.ai/v1/responses) as a native visual grounding fallback in linc-nerve for screens where uiautomator dump returns an empty or unlabelled UI hierarchy (custom Compose/Flutter/WebView canvases, games, and Wear OS watch surfaces).

What was built during the Hackathon window (after tag pre-hackathon-2026-10-26)

  • src/linc_nerve/core/grounding.py:
    • ground_visual_targets(image_bytes, prompt, screen_size, api_key): Calls sam-3.1 on Stage-1 screenshots, parses wire records via meta-sam-parser==0.1.0, decodes 1-bit masks to compute true mask center-of-mass, and scales coordinates into native device tap space (1080x2340 phone, 432x432 Wear OS watch, iOS logical points).
    • render_grounded_overlay(...): Renders translucent green bounding box + red centroid crosshair + confidence badge for visual verification.
    • should_suggest_visual_grounding(...): Detects empty trees, failed dumps, or unlabelled clickable Canvas controls.
  • src/linc_nerve/mcp/ui_tools.py: New nerve_ground(device, prompt, annotate=False) MCP tool + automatic visual_grounding_hint on nerve_elements and nerve_state.
  • src/linc_nerve/mcp/input_tools.py & src/linc_nerve/mcp/_core.py: Semantic nerve_tap(device, prompt=...) resolution integrated before coordinate guards and action logging.
  • tests/test_grounding.py: Unit and contract tests against live sam-3.1 wire output.

@andreBurnt

Copy link
Copy Markdown
Contributor Author

Closing direct mirror PR — releasing via canonical linc-nerve -> linc-publish pipeline.

@andreBurnt andreBurnt closed this Oct 27, 2026
@andreBurnt
andreBurnt deleted the hackathon/muse-sam branch October 27, 2026 17:57
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