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:
- HeadDetection (head_detection.yml) — YOLO-based multi-head detector, plus an optional HeadSelection post-processor.
- CoSI (cosi.yml) — confidence-coordinated spatial integration model for gaze point and social gaze relation prediction.
Dependency graph:
head/detection→head/gaze_point(single-person gaze following)head/detection→head/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, default640): Input image size. Affects detection speed and accuracy.conf(number, default0.25): Detection confidence threshold. Filters low-confidence boxes.iou(number, default0.45): IoU threshold for NMS deduplication.max_det(integer, default20): 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, default1): Number of head detections to keep.method(selection, defaultmax_size):max_sizeormax_confidence. Selection criterion for top detections.sort(selection, defaultleft-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 withcv2.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
principalandassociate: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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3f5fe96b34986d80b8aacd3d2ec34f7fd6a425cbfb70c6b68e30f9eca84ae16
|
|
| MD5 |
bdf5aaae281dfbce632b801039eee487
|
|
| BLAKE2b-256 |
16d6abb045442a91fd74da46a96949c79b4256a4cff7988437ebf5f702e0ef8a
|
Provenance
The following attestation bundles were made for seetapsych_gaze_follow-0.0.2.tar.gz:
Publisher:
publish.yml on seetapsych/seetapsych-gaze-follow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seetapsych_gaze_follow-0.0.2.tar.gz -
Subject digest:
a3f5fe96b34986d80b8aacd3d2ec34f7fd6a425cbfb70c6b68e30f9eca84ae16 - Sigstore transparency entry: 2652813537
- Sigstore integration time:
-
Permalink:
seetapsych/seetapsych-gaze-follow@ea7afd3c38903e2dcc627ecca5a58608c0d2ed11 -
Branch / Tag:
refs/tags/r0.0.2 - Owner: https://github.com/seetapsych
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea7afd3c38903e2dcc627ecca5a58608c0d2ed11 -
Trigger Event:
push
-
Statement type:
File details
Details for the file seetapsych_gaze_follow-0.0.2-py3-none-any.whl.
File metadata
- Download URL: seetapsych_gaze_follow-0.0.2-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34fea534313804d3ce739bfde4de60da9991a3b06de89ec675f4b04f784e7184
|
|
| MD5 |
a93933af9bbeb69b26297c7c9b7e1523
|
|
| BLAKE2b-256 |
b235a22e5bd782757da627ca0e037d06849b42ee4be14fa39fdec34eb65b1b9b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seetapsych_gaze_follow-0.0.2-py3-none-any.whl -
Subject digest:
34fea534313804d3ce739bfde4de60da9991a3b06de89ec675f4b04f784e7184 - Sigstore transparency entry: 2652813582
- Sigstore integration time:
-
Permalink:
seetapsych/seetapsych-gaze-follow@ea7afd3c38903e2dcc627ecca5a58608c0d2ed11 -
Branch / Tag:
refs/tags/r0.0.2 - Owner: https://github.com/seetapsych
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea7afd3c38903e2dcc627ecca5a58608c0d2ed11 -
Trigger Event:
push
-
Statement type: