Base
Core abstractions for the feature extraction pipeline.
This module defines the BaseFeature abstract base class and its primary specializations: StaticFeature and DynamicFeature.
BaseFeature
Bases: ABC
The root abstract class for all PyEyesWeb features.
Defines the dual-API structure for all computational components:
- Streaming API (
__call__): Evaluates aSlidingWindow. - Pure Math API (
compute): Evaluates a raw NumPy array.
Source code in pyeyesweb/data_models/base.py
__call__(data)
abstractmethod
The Streaming API: Compute the feature using a SlidingWindow.
Handles state and buffering for real-time applications by processing the contents of the provided window.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/data_models/base.py
compute(data)
abstractmethod
The Pure Math API: Compute the feature from a raw NumPy array.
Stateless and designed for composition or offline data science.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/data_models/base.py
DynamicFeature
Bases: BaseFeature
Base class for features that require a time-series window.
Examples include smoothness, direction change, or any feature involving temporal variations.
Source code in pyeyesweb/data_models/base.py
__call__(data)
The Streaming API for dynamic features.
Extracts the full chronological tensor from the SlidingWindow and
passes it to the compute method.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/data_models/base.py
compute(data)
abstractmethod
The actual mathematical logic for a time-series window.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/data_models/base.py
StaticFeature
Bases: BaseFeature
Base class for features computed on a single frame.
Examples include posture analysis, spatial density, or instantaneous geometric properties.
Source code in pyeyesweb/data_models/base.py
__call__(data, **kwargs)
The Streaming API for static features.
Automatically extracts the latest frame from the SlidingWindow and
delegates to the compute method.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/data_models/base.py
compute(data)
abstractmethod
The actual mathematical logic for a single frame.
| Parameters: |
|
|---|
| Returns: |
|
|---|