This release is a pre-release and may not be stable for production use.
SeetaPsych Lib
A Computer Vision Toolkit for Face-based Psychological Measurement
SeetaPsych Lib is a Python library for face and body-based psychology analysis. It provides a modular Pipeline/Runner runtime and an optional Streamlit WebUI.
Requirements
- Python >= 3.10
- (Recommended) uv package manager: https://github.com/astral-sh/uv
Installation
Create Virtual Environment
It is recommended to use an isolated virtual environment before installing dependencies.
Using uv (recommended)
# Create a virtual environment at .venv
uv venv
# Activate (bash/zsh)
source .venv/bin/activate
# Activate (PowerShell)
.venv\Scripts\Activate.ps1
# Activate (Windows CMD)
.venv\Scripts\activate.bat
Using standard venv
python -m venv .venv
# bash/zsh
source .venv/bin/activate
# PowerShell
.venv\Scripts\Activate.ps1
# Windows CMD
.venv\Scripts\activate.bat
Using conda
conda create -n seetapsych python=3.10
conda activate seetapsych
Install Dependencies
Install the required dependencies:
- seetapsych-lib
- seetapsych-attributes
- seetapsych-configs
To run the WebUI, you need to install the seetapsych-lib[webui] package.
Using uv (recommended)
uv pip install 'seetapsych-lib[webui]' seetapsych-attributes seetapsych-configs
Using pip
pip install seetapsych-lib[webui] seetapsych-attributes seetapsych-configs
Install Default Configs
# download default configs
seetapsych-manager download
# install each module requirements
seetapsych-manager setup
# download each model
seetapsych-manager cache
The setup and cache commands can be skipped.
When you use the WebUI or call the library programmatically later, seetapsych-lib can install dependencies and download necessary models on demand.
Public Resources
The default modules installed with seetapsych-lib are published and maintained at https://github.com/seetapsych/seetapsych-configs.
To update the built-in modules to their latest versions, upgrade the configs package and re-download:
uv pip compile --upgrade-package seetapsych-configs
seetapsych-manager download -f
Algorithm inputs and execution outputs are defined via Attributes.
The full Attributes specification is available at https://github.com/seetapsych/seetapsych-attributes.
Quick Start
Run WebUI (Streamlit)
seetapsych-webui --log INFO
or
python -m seetapsych_lib.webui --log INFO
A local browser window will open automatically, or you can manually navigate to: http://localhost:8501.
Common arguments:
--dirs <DIR...>: load modules from directories--files <FILE...>: load modules from local config files--urls <URL...>: load modules from remote URLs--disable-builtin: disable builtin modules--disable-default: disable default modules--cache-dir <DIR>: model cache directory--upload-dir <DIR>: upload directory--log <LEVEL>: log level (e.g.,DEBUG,INFO,WARNING, or an integer like10)
Programmatic Usage
# -*- coding: utf-8 -*-
import json
import cv2
from seetapsych_lib.runtime.factory import Factory
from seetapsych_lib.runtime.pipeline import Pipeline
from seetapsych_lib.runtime.runner import Runner
from seetapsych_lib.runtime.parallel_runner import ParallelRunner
def main():
# All installed algorithm modules are loaded by default during initialization
# You can use the `load_xxx_module(s)` methods to load specific algorithm modules
factory = Factory()
# Quickly build a workflow and declare the attribute to compute as the face feature 'face/detection'
# You can view all available attributes of installed algorithms using the `seetapsych-manager show` command
# Result fields for attributes can be found at https://github.com/seetapsych/seetapsych-attributes
pipeline = Pipeline(factory, attributes=["face/detection"])
# Check for dependencies or missing issues that need to be resolved with solve()
print(pipeline.problem())
# Resolve workflow dependencies, automatically add face detection and corresponding models
pipeline.solve()
# Check for runtime environment issues that require installation or download to fix
print(pipeline.satisfied())
# Install missing dependencies required for the current pipeline to run
pipeline.install_requirements()
# Download missing models required for the pipeline to run
pipeline.cache_models()
# Create a basic executor
runner = Runner(pipeline)
# Or create a parallel executor
# runner = ParallelRunner(pipeline)
# Run the algorithm
report = runner.run(data={"default": cv2.imread("image.jpg")})
# Print the execution results
print(json.dumps(report, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
Built-in Modules
SeetaPsych Lib ships with a built-in module SelectFace for pipelines that need to reduce multi-face detection results down to a single tracked face before running downstream single-face algorithms.
Module Catalog
| Module Config | Packages |
|---|---|
| face_selection.yml | SelectFace |
SelectFace
Module: SelectFace — Select one target face from multi-face detection outputs for single-face downstream pipelines.
- Module config: face_selection.yml
| Package Name | Provides Attributes | Requires Attributes |
|---|---|---|
| SelectFace | face/selection, face/detection |
face/detection |
Description: Select one face from detections by max area or max-tracking with PID increments on target change. Use as a post-process between multi-face detectors (RetinaFace / MediaPipe / InsightFace) and any single-face consumer (emo / hr / dense_landmarks / arcface / gaze).
Parameters:
| Name | Type | Default | Description & Tuning |
|---|---|---|---|
selection_mode |
selection (MAX_TRACKING, MAX) |
MAX_TRACKING |
Strategy for selecting from multiple faces. MAX_TRACKING adds temporal stability and increments PID on target switch — recommended for video. MAX picks the largest face every frame — use for single static images. |
Models: (none — pure post-process)
Configuration
Environment Variables
The following environment variables are supported:
| Env | Description |
|---|---|
| SEETAPSYCH_LOG_LEVEL | Change default log level. Could be WARNING, INFO, DEBUG, or an integer (e.g., 10). |
| SEETAPSYCH_CACHE_DIR | Base directory for model cache. Models are cached under <CACHE_DIR>/models. |
| SEETAPSYCH_CONFIG_DIR | Base directory for config files. Config files are loaded from <CONFIG_DIR>/configs. |
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_lib-0.0.3rc1.tar.gz.
File metadata
- Download URL: seetapsych_lib-0.0.3rc1.tar.gz
- Upload date:
- Size: 276.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d991f6496f8047a271525239408e3fbbe9600b4c13322fb596609a9df162c0af
|
|
| MD5 |
33d830ad9f2b2ecc9eca39ed98496e82
|
|
| BLAKE2b-256 |
91d19fe1004871e0d9c722c5ab29c678c92fd8d1fcf81bbfbee979bc41a2706c
|
Provenance
The following attestation bundles were made for seetapsych_lib-0.0.3rc1.tar.gz:
Publisher:
publish.yml on seetapsych/seetapsych-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seetapsych_lib-0.0.3rc1.tar.gz -
Subject digest:
d991f6496f8047a271525239408e3fbbe9600b4c13322fb596609a9df162c0af - Sigstore transparency entry: 2663246858
- Sigstore integration time:
-
Permalink:
seetapsych/seetapsych-lib@926cc06e1b3a6e31aa87b5736eb73732dfaee55a -
Branch / Tag:
refs/tags/r0.0.3.rc1 - Owner: https://github.com/seetapsych
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@926cc06e1b3a6e31aa87b5736eb73732dfaee55a -
Trigger Event:
push
-
Statement type:
File details
Details for the file seetapsych_lib-0.0.3rc1-py3-none-any.whl.
File metadata
- Download URL: seetapsych_lib-0.0.3rc1-py3-none-any.whl
- Upload date:
- Size: 77.5 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 |
a1d544669d9e5f926ada444e20c746196b5fbe1709d4af8fdae2ad030a0d02ea
|
|
| MD5 |
c0723282ff09db4fefd8ef1c722bc4ad
|
|
| BLAKE2b-256 |
04057b7f5ac58a2c0060b8a4a24cf1272334ffbc3e45a229e15df6c4b4f6b599
|
Provenance
The following attestation bundles were made for seetapsych_lib-0.0.3rc1-py3-none-any.whl:
Publisher:
publish.yml on seetapsych/seetapsych-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seetapsych_lib-0.0.3rc1-py3-none-any.whl -
Subject digest:
a1d544669d9e5f926ada444e20c746196b5fbe1709d4af8fdae2ad030a0d02ea - Sigstore transparency entry: 2663246895
- Sigstore integration time:
-
Permalink:
seetapsych/seetapsych-lib@926cc06e1b3a6e31aa87b5736eb73732dfaee55a -
Branch / Tag:
refs/tags/r0.0.3.rc1 - Owner: https://github.com/seetapsych
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@926cc06e1b3a6e31aa87b5736eb73732dfaee55a -
Trigger Event:
push
-
Statement type: