Skip to main content

SeetaPsych Lib

A Computer Vision Toolkit for Face-based Psychological Measurement

License

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

Installation

Using uv (recommended)

uv pip install 'seetapsych-lib[webui]' seetapsych-attributes seetapsych-configs

Using pip

Install runtime dependencies:

pip install seetapsych-lib seetapsych-attributes seetapsych-configs

If you want to run the WebUI, install extra tools manually:

pip install 'seetapsych-lib[webui]'

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.

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 like 10)

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()

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

seetapsych_lib-0.0.1-py3-none-any.whl (72.0 kB view details)

Uploaded Python 3

File details

Details for the file seetapsych_lib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: seetapsych_lib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 72.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.11

File hashes

Hashes for seetapsych_lib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 801ff9656f008efcc17931475cc9548eacf9eeb18da37c0818a1a1d0e644e039
MD5 c2a79b23911b75070b9e8d43b81a01a9
BLAKE2b-256 ea450b7932c0c197062fc5aee978b2a01ec63ab023f269a893c4520eaf502eb2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.3.post2

2 files

0.0.3.post1

2 files

0.0.3

2 files

0.0.2.post1

2 files

0.0.2

2 files

0.0.1.post1

1 file

This release

0.0.1 This release

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