Metadata-Version: 2.5
Name: seetapsych-gaze-screen
Version: 0.0.3rc1
Summary: Gaze estimation modules for SeetaPsych
Project-URL: Homepage, https://github.com/seetapsych/seetapsych-gaze-screen
Project-URL: Repository, https://github.com/seetapsych/seetapsych-gaze-screen
Project-URL: Issues, https://github.com/seetapsych/seetapsych-gaze-screen/issues
License: BSD 3-Clause License
        
        Copyright (c) 2026, Visual Information Processing and Learning (VIPL) group,
        Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China;
        Southeast University, China;
        Beijing Seetatech Co., Ltd.
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
        LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
        CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
        ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
        POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: seetapsych-lib
Provides-Extra: all
Requires-Dist: mediapipe>=0.10.33; extra == 'all'
Requires-Dist: mmengine>=0.10.7; extra == 'all'
Requires-Dist: numpy>=2.2.6; extra == 'all'
Requires-Dist: onnx>=1.20.1; extra == 'all'
Requires-Dist: onnxruntime-gpu<1.24; (sys_platform != 'darwin' and python_version <= '3.10') and extra == 'all'
Requires-Dist: onnxruntime-gpu>=1.24; (sys_platform != 'darwin' and python_version > '3.10') and extra == 'all'
Requires-Dist: onnxruntime<1.24; (sys_platform == 'darwin' and python_version <= '3.10') and extra == 'all'
Requires-Dist: onnxruntime>=1.24; (sys_platform == 'darwin' and python_version > '3.10') and extra == 'all'
Requires-Dist: opencv-python>=4.13.0.92; extra == 'all'
Requires-Dist: pillow>=12.2.0; extra == 'all'
Requires-Dist: safetensors>=0.7.0; extra == 'all'
Requires-Dist: scipy>=1.15.3; extra == 'all'
Requires-Dist: timm>=1.0.26; extra == 'all'
Requires-Dist: torch>=2.9.1; extra == 'all'
Requires-Dist: torchvision>=0.24.1; extra == 'all'
Provides-Extra: dev
Requires-Dist: bandit>=1.7; extra == 'dev'
Requires-Dist: build>=1.4.4; extra == 'dev'
Requires-Dist: mediapipe>=0.10.33; extra == 'dev'
Requires-Dist: mmengine>=0.10.7; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: numpy>=2.2.6; extra == 'dev'
Requires-Dist: onnx>=1.20.1; extra == 'dev'
Requires-Dist: onnxruntime-gpu<1.24; (sys_platform != 'darwin' and python_version <= '3.10') and extra == 'dev'
Requires-Dist: onnxruntime-gpu>=1.24; (sys_platform != 'darwin' and python_version > '3.10') and extra == 'dev'
Requires-Dist: onnxruntime<1.24; (sys_platform == 'darwin' and python_version <= '3.10') and extra == 'dev'
Requires-Dist: onnxruntime>=1.24; (sys_platform == 'darwin' and python_version > '3.10') and extra == 'dev'
Requires-Dist: opencv-python>=4.13.0.92; extra == 'dev'
Requires-Dist: pillow>=12.2.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: safetensors>=0.7.0; extra == 'dev'
Requires-Dist: scipy-stubs>=1.15.3.0; extra == 'dev'
Requires-Dist: scipy>=1.15.3; extra == 'dev'
Requires-Dist: timm>=1.0.26; extra == 'dev'
Requires-Dist: torch>=2.9.1; extra == 'dev'
Requires-Dist: torchvision>=0.24.1; extra == 'dev'
Requires-Dist: twine>=6.2.0; extra == 'dev'
Description-Content-Type: text/markdown

# SeetaPsych Gaze

> Gaze estimation modules for SeetaPsych

## 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](https://github.com/seetapsych/seetapsych-lib).

The gaze estimation algorithms depend on `open-gaze-estimation`. Please install it from GitHub separately:

```bash
uv pip install git+https://github.com/Elorfiniel/open-gaze-estimation-2025-release.git
```

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_screen/modules/affnet.yml \
  seetapsych_gaze_screen/modules/itracker-plus.yml \
  seetapsych_gaze_screen/modules/tdgazenet.yml
```

### Programmatic Usage

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

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

factory = Factory()
factory.load_file_modules("seetapsych_gaze_screen/modules/affnet.yml")

pipeline = Pipeline(factory, ...)

pipeline.add_attributes("face/gaze_screen")
```

### Module Catalog

| Module YAML | Package Name |
|---|---|
| `affnet.yml` | GazeScreen-AFFNet(OpenGaze) |
| `itracker-plus.yml` | GazeScreen-ITrackerPlus(OpenGaze) |
| `tdgazenet.yml` | GazeScreen-TDGazeNet(OpenGaze) |

### GazeScreen-AFFNet(OpenGaze)

> Open-source gaze estimation toolkit providing screen gaze coordinates from facial landmarks or mesh.

Module config: [affnet.yml](seetapsych_gaze_screen/modules/affnet.yml)

| Package | Provides | Requires |
|---|---|---|
| GazeScreen-AFFNet(OpenGaze) | `face/gaze_screen` | `face/mesh` |

**Description**

Estimate screen gaze coordinates via AFFNet attention fusion network; outputs one shared gaze vector applied to both eyes. Suitable for single-user desktop scenarios with medium accuracy and compute cost.

**Parameters**

| Name | Type | Default | Description |
|---|---|---|---|
| `data` | object | *(see yml)* | Camera/screen calibration and image preprocessing settings. camera and screen physical dimensions (mm/px) and sensor frame size must match the real setup for accurate gaze projection; adjust_size resizes input for throughput, larger increases accuracy but slows inference. |

**Models**

| Model | Version | Recommended |
|---|---|---|
| `opengaze-affnet-v2.safetensors` | 2.0 | ✓ |
| `opengaze-affnet.safetensors` | 1.0 |  |

### GazeScreen-ITrackerPlus(OpenGaze)

> Open-source gaze estimation toolkit providing screen gaze coordinates from facial landmarks or mesh.

Module config: [itracker-plus.yml](seetapsych_gaze_screen/modules/itracker-plus.yml)

| Package | Provides | Requires |
|---|---|---|
| GazeScreen-ITrackerPlus(OpenGaze) | `face/gaze_screen` | `face/mesh` |

**Description**

Lightweight eye-and-face gaze point estimation; outputs one shared gaze vector applied to both eyes. Best for resource-constrained devices or real-time low-latency use cases with acceptable accuracy.

**Parameters**

| Name | Type | Default | Description |
|---|---|---|---|
| `data` | object | *(see yml)* | Camera/screen calibration and image preprocessing settings. camera and screen physical dimensions (mm/px) and sensor frame size must match the real setup for accurate gaze projection; adjust_size resizes input for throughput, larger increases accuracy but slows inference. |

**Models**

| Model | Recommended |
|---|---|
| `opengaze-itrackerplus.onnx` | ✓ |

### GazeScreen-TDGazeNet(OpenGaze)

> Open-source gaze estimation toolkit providing screen gaze coordinates from facial landmarks or mesh.

Module config: [tdgazenet.yml](seetapsych_gaze_screen/modules/tdgazenet.yml)

| Package | Provides | Requires |
|---|---|---|
| GazeScreen-TDGazeNet(OpenGaze) | `face/gaze_screen` | `face/mesh` |

**Description**

High-accuracy gaze estimation via TdGazeNet with 3D face prior, camera intrinsics and multi-task head; outputs distinct per-eye gaze vectors for left and right eye. Highest accuracy among OpenGaze variants at the cost of heavier compute.

**Parameters**

| Name | Type | Default | Description |
|---|---|---|---|
| `optimize` | selection | `none` | Post-load structural optimization of the backbone. Set to reparameterize to fold BatchNorm into convolutions for faster inference at load-time cost; use none for training or debug workflows where exact weights must be preserved. Possible values: `none`, `reparameterize`. |
| `data` | object | *(see yml)* | Model topology, camera/screen calibration and image preprocessing settings. camera intrinsic/extrinsic/distortion matrices and screen physical dimensions must match the real setup for the 3D-face-prior projection to be accurate; image_size and bbox_scale tune face crop resolution vs. context margin. |

**Models**

| Model | Recommended |
|---|---|
| `opengeze-tdgazenet.safetensors` | ✓ |
