Skip to main content

SeetaPsych Gaze Follow

Gaze following estimation modules for SeetaPsych. Detects heads in scene and estimates where each person is looking (gaze point on image plane, and social gaze relations between people).

Usage

This project is already included in the seetapsych-lib default configuration. Download and use it via seetapsych-manager download.

For usage, refer to SeetaPsych.

Install optional algorithm dependencies:

uv pip install seetapsych-gaze-follow[all]

The algorithm modules automatically download model weights from ModelScope on first use, so the initial run may be slower due to model downloading.

You can additionally add this algorithm module using the following methods.

WebUI

Run seetapsych-webui with the --files argument to use it.

seetapsych-webui --files \
  seetapsych_gaze_follow/modules/head_detection.yml \
  seetapsych_gaze_follow/modules/cosi.yml

Programmatic Usage

Add the following code in your program to use this algorithm module.

from seetapsych_lib.runtime.factory import Factory
from seetapsych_lib.runtime.pipeline import Pipeline

factory = Factory()
factory.load_file_modules("seetapsych_gaze_follow/modules/head_detection.yml")
factory.load_file_modules("seetapsych_gaze_follow/modules/cosi.yml")

pipeline = Pipeline(factory, ...)

pipeline.add_attributes("head/detection", "head/gaze_point")
# Or for dyadic social gaze:
# pipeline.add_attributes('head/detection', 'head/social_gaze')

Module Pipeline

The gaze following pipeline consists of two stages loaded from separate module configs:

  1. HeadDetection (head_detection.yml) — YOLO-based multi-head detector, plus an optional HeadSelection post-processor.
  2. CoSI (cosi.yml) — confidence-coordinated spatial integration model for gaze point and social gaze relation prediction.

Dependency graph:

  • head/detectionhead/gaze_point (single-person gaze following)
  • head/detectionhead/social_gaze (dyadic social gaze, requires ≥ 2 detected heads)

Introduction

HeadDetection (YOLO)

Ultralytics YOLO-based head detection module. Detects multiple human heads per frame with per-box confidence scores. Includes a built-in HeadSelection post-package for filtering and sorting detections before gaze estimation.

Module config: head_detection.yml.

Packages:

1. HeadDetection(CoSI)

  • Provides Attributes: head/detection
  • Requires: (none)
  • Entry: seetapsych_gaze_follow.head_detection.package.load
  • Available model: seeta-gaze-follow-yolo_head.pt
  • Parameters:
    • img_size (integer, default 640): Input image size. Affects detection speed and accuracy.
    • conf (number, default 0.25): Detection confidence threshold. Filters low-confidence boxes.
    • iou (number, default 0.45): IoU threshold for NMS deduplication.
    • max_det (integer, default 20): Maximum detection boxes per frame, for multi-person scenarios.

2. HeadSelection

  • Provides Attributes: head/selection, head/detection (overwrites with sorted/filtered list)
  • Requires: head/detection
  • Entry: seetapsych_gaze_follow.head_selection.package.load
  • Priority: 100 (runs after HeadDetection)
  • Parameters:
    • count (integer, default 1): Number of head detections to keep.
    • method (selection, default max_size): max_size or max_confidence. Selection criterion for top detections.
    • sort (selection, default left-right): left-right, right-left, top-bottom, bottom-top. Sort order for selected detections.

CoSI — Confidence-Coordinated Spatial Integration Gaze Follow

PyTorch/timm-based CoSI gaze following model. Takes the full image plus each detected head bounding box, and predicts the per-head 2D gaze point on the image plane with an associated attention heatmap. Supports two inference modes: single-person gaze point prediction per head, and dyadic social gaze relation classification between two people (principal ↔ associate). Built on Hydra config with eval_dyadic stage and confidence_coordinated integration. Input resolution: 448×448.

Module config: cosi.yml.

Packages:

1. HeadGazePoint(CoSI)

  • Provides Attributes: head/gaze_point
  • Requires: head/detection
  • Entry: seetapsych_gaze_follow.cosi.gaze_point.load
  • Available model: seeta-gaze-follow-cosi_weights.pth
  • Per-head output fields:
    • head_location_xyxy: The source head box used for prediction.
    • gaze_point_px: Predicted 2D gaze point (pixel coordinates on the original image).
    • heatmap: Floating-point attention heatmap (can be visualized with cv2.COLORMAP_JET).

2. HeadSocialRelation(CoSI)

  • Provides Attributes: head/social_gaze
  • Requires: head/detection (requires ≥ 2 detected heads)
  • Entry: seetapsych_gaze_follow.cosi.social_gaze.load
  • Available model: seeta-gaze-follow-cosi_weights.pth (shared with HeadGazePoint)
  • Behaviour: Selects the top-2 highest-confidence detections, orders them horizontally (left = principal, right = associate), and runs dyadic prediction.
  • Output fields for each of principal and associate:
    • head_location_xyxy: The source head box.
    • gaze_point_px: Predicted gaze point in pixel coordinates.
    • heatmap: Per-person attention heatmap.
    • social_gaze_id: Integer class ID of the social gaze relation. Ordered mapping: 0=share, 1=mutual, 2=single, 3=miss, 4=void.
    • social_gaze_label: Human-readable social gaze relation label. Possible values: share, mutual, single, miss, void. Index of the value matches social_gaze_id.

Download files

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

Source Distribution

seetapsych_gaze_follow-0.0.2.tar.gz (257.6 kB view details)

Uploaded Source

Built Distribution

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

seetapsych_gaze_follow-0.0.2-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file seetapsych_gaze_follow-0.0.2.tar.gz.

File metadata

  • Download URL: seetapsych_gaze_follow-0.0.2.tar.gz
  • Upload date:
  • Size: 257.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for seetapsych_gaze_follow-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a3f5fe96b34986d80b8aacd3d2ec34f7fd6a425cbfb70c6b68e30f9eca84ae16
MD5 bdf5aaae281dfbce632b801039eee487
BLAKE2b-256 16d6abb045442a91fd74da46a96949c79b4256a4cff7988437ebf5f702e0ef8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for seetapsych_gaze_follow-0.0.2.tar.gz:

Publisher: publish.yml on seetapsych/seetapsych-gaze-follow

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

File details

Details for the file seetapsych_gaze_follow-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for seetapsych_gaze_follow-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34fea534313804d3ce739bfde4de60da9991a3b06de89ec675f4b04f784e7184
MD5 a93933af9bbeb69b26297c7c9b7e1523
BLAKE2b-256 b235a22e5bd782757da627ca0e037d06849b42ee4be14fa39fdec34eb65b1b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for seetapsych_gaze_follow-0.0.2-py3-none-any.whl:

Publisher: publish.yml on seetapsych/seetapsych-gaze-follow

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

Release history Release notifications | RSS feed

0.0.3.post1

2 files

0.0.3

2 files

This release

0.0.2 This release

2 files

0.0.1

1 file

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