Skip to main content

Predict visual attention on UI screenshots — heatmap overlays and machine-readable attention scores

Project description

HotGaze ⏿

CI License: MIT Python 3.10+

Attention heatmaps for UI screenshots — with numeric scores and A/B compare, not just pretty pictures.

Predict where users' eyes land on a design, get a machine-readable attention share for any region, and diff two variants to see which one wins and by how much. Local, offline, MIT-licensed.

Original design next to its HotGaze attention overlay — headline, CTA, and sidebar items glow hot

Status: v0.1 alpha. The fast heuristic backend, region scoring, A/B compare, and deep UNISAL backend are shipping. Faces layer (YuNet) is available via --layers faces. API and CLI may change before v1.

Why this exists

Every existing attention-prediction tool — paid (HeatScope, Attention Insight, EyeQuant) and free (Foveacast) — stops at a colored overlay for a human to eyeball. That's fine for a designer squinting at a mockup. It's useless when you want to:

  • Compare two design variants and quantify which one draws more attention to the CTA.
  • Wire attention checks into CI ("your button just lost 23% of its attention").
  • Script or automate any part of the design-review loop.

HotGaze outputs the picture too, but the picture isn't the point. The numbers are.

Install

Not on PyPI yet (v0.1 is a working-directory install):

git clone https://github.com/suryakosaraju/hotgaze
cd hotgaze
pip install -e .

Python 3.10+. Runs on macOS and Linux. No cloud, no API keys, no telemetry.

Quickstart

# Generate an attention overlay
hotgaze run screenshot.png -o overlay.png

# Score a specific region — how much attention does the CTA get?
hotgaze score screenshot.png --region cta:250,200,200,35 --json

# Compare two variants — which one wins?
hotgaze compare landing_a.png landing_b.png --region cta:250,200,200,35

The differentiator: numbers, not just pictures

Score any region. Attention share, peak value, rank — canonical JSON, deterministic on the same machine:

$ hotgaze score design.png --region cta:250,200,200,35 --json
{
  "schema": 1,
  "regions": [
    {"name": "cta", "share": 0.035, "peak_value": 0.769, "rank": 1}
  ],
  "focal_points": [...]
}

Compare two variants. Per-region deltas, plus a 3×3 spatial grid showing where attention moved:

$ hotgaze compare landing_a.png landing_b.png --region cta:250,200,200,35 --json
{
  "compare": {
    "per_region_deltas": [
      {"name": "cta", "share_a": 0.035, "share_b": 0.022, "delta": -0.013}
    ]
  }
}

Variant B lost 37% of the CTA's attention share. That's an actionable number, not "the heatmap looks about the same."

What's in the box

  • CLI: hotgaze run, hotgaze score, hotgaze compare, hotgaze info.
  • Fast heuristic backend (default): spectral-residual saliency + contrast + center bias + F-pattern reading prior. No downloads, works offline, sub-second on CPU.
  • Deep saliency backend (--backend deep): UNISAL (Apache-2.0), CPU-only, deterministic per-machine. Install: pip install hotgaze[deep]. Weights download on first use (one-time, ~30 MB).
  • Faces layer (--layers faces): YuNet (MIT) face detection adds attention blobs over detected faces.
  • Versioned JSON output: schema v1 covers both score and compare modes so downstream tools don't break on new features.
  • Deterministic: same image + same config + same machine → byte-identical JSON.

Backends

Backend Default What it uses Quality
fast Spectral residual + contrast + center bias + gaze flow Strong on flat UI screenshots; zero downloads
deep UNISAL pretrained saliency model (PyTorch) Better on natural images; on flat UIs the fast backend often matches or exceeds it — the domain gap is real.

--backend deep requires pip install hotgaze[deep] and a one-time weight download on first use. Both backends are fully offline after the initial fetch.

What HotGaze isn't

  • Not real eye-tracking. It's a prediction from computer-vision priors. Useful for early design review; not a substitute for a user study.
  • Not a conversion oracle. Attention share correlates with visibility, not with conversion — high attention on a bad CTA still doesn't sell.
  • Not a designer GUI. It's a scriptable tool for developers. A GUI/Figma plugin is roadmap, not v1.

Roadmap

  • v0.2 — PyPI release, GitHub Action for attention regression testing on PR screenshots.
  • v0.3+ — UI-tuned text/saliency models, Figma plugin, macOS wrapper, benchmarking against public saliency datasets.

License

MIT. See LICENSE.

Third-party models and dependencies are recorded with their licenses and redistribution status in LICENSES-THIRD-PARTY.md.

Credits

Predictive saliency stands on decades of vision research. The deep backend builds on UNISAL (Droste et al.). The fast backend implements Hou & Zhang's spectral-residual approach (2007). Face detection uses YuNet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hotgaze-0.1.0.tar.gz (167.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hotgaze-0.1.0-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file hotgaze-0.1.0.tar.gz.

File metadata

  • Download URL: hotgaze-0.1.0.tar.gz
  • Upload date:
  • Size: 167.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hotgaze-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3a173ca7496e7d6c6b0915b50cdee86860175648605e5c91df92b7c1337a7d1
MD5 81f9af1e0a5659665eb5ddb42d56286e
BLAKE2b-256 55740bdff6e7a09b1ede64d1979e8834b248dd98527de889903fb2778479f7c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotgaze-0.1.0.tar.gz:

Publisher: release.yml on suryakosaraju/hotgaze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hotgaze-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hotgaze-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hotgaze-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61207ed9b7d5eaa91450b43b48de5ff65d508c72b298ef2bbc7112b10f6e731b
MD5 960384e7605e54e55aabe45fbbfc985a
BLAKE2b-256 570e2e45dfb4f87a5f2154b541af57bef7acd54b9acbd8c1d73e90a37da4111a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotgaze-0.1.0-py3-none-any.whl:

Publisher: release.yml on suryakosaraju/hotgaze

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page