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 Catalog

YAML Path Packages
head_detection.yml HeadDetection-CoSIGaze, HeadSelection
cosi.yml SceneGazeFollow-CoSIGaze, SocialGaze-CoSIGaze

Module Pipeline

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

  1. HeadDetection (head_detection.yml) — 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)

HeadDetection

Ultralytics multi-person head detector with pluggable selection/sorting post-process, used as the front-end for CoSI gaze-following models.

Module config: head_detection.yml

Package Name Provides Attributes Requires Attributes
HeadDetection-CoSIGaze head/detection (none)
HeadSelection head/selection, head/detection head/detection

HeadDetection-CoSIGaze

Description: multi-person head detector with configurable confidence and NMS thresholds; produces head bounding boxes consumed by CoSI gaze-following and social-gaze packages.

Parameters

Name Type Default Description
img_size integer 640 Input image size for inference, larger values improve small-head recall but increase latency and VRAM usage; keep as multiples of 32 (640 is a balanced default).
conf number 0.25 Minimum detection confidence threshold, raise to reduce false positives in crowded scenes (0.35-0.5 typical), lower to recover faraway/occluded heads (0.15-0.2).
iou number 0.45 NMS IoU threshold for duplicate suppression, lower (0.3-0.4) removes more overlapping boxes for dense crowds, higher (0.5-0.6) keeps more candidates for closely-spaced heads.
max_det integer 20 Maximum detection boxes kept per frame after NMS; set to the expected upper bound of simultaneous people in the scene (e.g. 2-4 for dyads, 10-20 for audiences) to avoid noisy downstream cost.

Models

Name Recommended
seeta-gaze-follow-yolo_head.pt

HeadSelection

Description: Post-process that selects top-N head detections by size or confidence, then reorders them spatially (left-right/top-bottom) before passing to downstream gaze-following or social-gaze modules.

Parameters

Name Type Default Selection Description
count integer 1 Number of heads to keep after selection; match the number of tracked people in the scene, e.g. 1 for single-target, 2 for dyadic social-gaze analysis.
method selection max_size max_size, max_confidence Criterion used to pick the top-N heads. Use max_size to prefer closest/largest heads (dominant foreground person); use max_confidence when occlusion is rare and detector score is trustworthy.
sort selection left-right left-right, right-left, top-bottom, bottom-top Spatial order applied after selection. left-right matches screen reading order and is recommended for dyadic social-gaze (left = principal, right = associate); top-bottom is better for vertically stacked layouts.

Models: (none)

CoSIGaze

Confidence-coordinated Spatial Integration (CoSI) transformer for multi-person gaze following and dyadic social-gaze relation classification from a single RGB scene image.

Module config: cosi.yml

Package Name Provides Attributes Requires Attributes
SceneGazeFollow-CoSIGaze head/gaze_point head/detection
SocialGaze-CoSIGaze head/social_gaze head/detection

SceneGazeFollow-CoSIGaze

Description: Per-head scene-level gaze-following with CoSI transformer; for every input head box returns a 2D gaze target point (gaze_point_px) and a per-pixel gaze heatmap on the original scene image.

Parameters: (none)

Models

Name Recommended
seeta-gaze-follow-cosi_weights.pth

SocialGaze-CoSIGaze

Description: Dyadic social-gaze relation classifier using the shared CoSI transformer backbone; picks the top-2 most confident heads ordered horizontally (left = principal, right = associate) and predicts a 5-class relation, plus per-person gaze point and heatmap.

Parameters: (none)

Models

Name Recommended
seeta-gaze-follow-cosi_weights.pth

SocialGaze class mapping (social_gaze_id → social_gaze_label):

ID Label
0 share
1 mutual
2 single
3 miss
4 void

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.3.tar.gz (258.0 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.3-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: seetapsych_gaze_follow-0.0.3.tar.gz
  • Upload date:
  • Size: 258.0 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.3.tar.gz
Algorithm Hash digest
SHA256 6346bc5828fb6690ace7ec7068d587a318caab7e3235366b17406e9d2ed4f241
MD5 01989a4f89b1ef64290728885e732929
BLAKE2b-256 41f97584f89b27f681895e037d6bac39888d839b5fbe3142674105d99da1f1ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for seetapsych_gaze_follow-0.0.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for seetapsych_gaze_follow-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 22effbaed071dfecf1795f7e2ffd0ae4b1ac93264f3a3602baf374b1d70f1e09
MD5 4f157729675d2507831ca8edb9705b2f
BLAKE2b-256 c4c1c1263e5407eaae742efbf7477ab302937a17b05ecbc90572c8d52e4f64b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for seetapsych_gaze_follow-0.0.3-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

This release

0.0.3 This release

2 files

0.0.2

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