Skip to main content

scanpath_nlp_metrics

NLP and spatial metrics for scanpath comparison using Vision-Language Models.

Installation

pip install scanpath_nlp_metrics

Quick Start

from scanpath_nlp_metrics import ScanpathComparator

comparator = ScanpathComparator(
    vlm_base_url="http://localhost:8000/v1",
    vlm_api_key="your-key",
    vlm_model="qwen2-vl-7b-instruct",
    method="patch",       # or "marker"
    patch_size=96,        # for patch method
    marker_radius=100,     # for marker method
)

result = comparator.compare(
    scanpath_a=[[100, 200, 0.3], [150, 250, 0.2], ...],
    scanpath_b=[[120, 210, 0.25], [160, 240, 0.15], ...],
    image="path/to/image.jpg",
)

Output

{
    "description_a": "The viewer first looked at the person's face...",
    "description_b": "The viewer focused on the main subject...",
    "rouge": 0.45,
    "bleu": 0.32,
    "bert_score": 0.67,
    "bm25": 0.55,
    "scanmatch": 0.78,
    "dtw": 0.82,
    "hausdorff": 0.65,
    "levenshtein": 0.70,
    "tde": 0.75,
    "multimatch_vector": 0.65,
    "multimatch_direction": 0.71,
    "multimatch_length": 0.68,
    "multimatch_position": 0.72,
    "multimatch_duration": 0.55,
    "multimatch_mean": 0.66,
}

Configuration

Parameter Default Description
vlm_base_url http://localhost:8000/v1 VLM API endpoint
vlm_api_key x API key
vlm_model qwen2-vl-7b-instruct Model name
method patch Generation method: patch or marker
patch_size 96 Patch size in pixels
marker_radius 100 Marker radius in pixels
screen_size (1680, 1050) Screen resolution
metrics all List of metrics to compute

Available Metrics

  • NLP: rouge, bleu, bert_score, bm25
  • Spatial: scanmatch, dtw, hausdorff, levenshtein, tde
  • MultiMatch: multimatch_vector, multimatch_direction, multimatch_length, multimatch_position, multimatch_duration, multimatch_mean

License

AGPL-2.0 - See LICENSE file for details.

Metadata

Release files for scanpath-nlp-metrics 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scanpath-nlp-metrics 0.0.1
File Size Uploaded Provenance Actions
scanpath_nlp_metrics-0.0.1.tar.gz 26.1 kB Without provenance Details for scanpath_nlp_metrics-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scanpath-nlp-metrics 0.0.1
File Interpreter ABI Platform Actions
scanpath_nlp_metrics-0.0.1-py3-none-any.whl Python 3 none any Details for scanpath_nlp_metrics-0.0.1-py3-none-any.whl

Total release size: 53.5 kB

Release files / scanpath_nlp_metrics-0.0.1.tar.gz

Download URL scanpath_nlp_metrics-0.0.1.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f9529ddadd893901a8dde41e7725cf96920bee2ebf8be40bb57e89641920bcfd
BLAKE2b-256 checksum
How to use checksums
cb4bc065871d379f91f1348c6ee520aedc685010ea637f67441c10ace9612f52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / scanpath_nlp_metrics-0.0.1-py3-none-any.whl

Download URL scanpath_nlp_metrics-0.0.1-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4288c00fdf70bfef0a2ff6597464ea902675d3f4a96907b33a8d150687c792e8
BLAKE2b-256 checksum
How to use checksums
de791e5cfcf94431256b12f130d893b5e07527f59d488f5a324e42dce865ba69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for scanpath-nlp-metrics 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page