Install the TheiaSDK Python package using pip:
pip install git+https://github.com/harmoneyes/HarmonEyesTheia.git
TheiaSDK requires a valid license key. Contact us to obtain a license.
| Platform | Description |
|---|---|
| "PL" | Pupil Labs Neon |
| "WT" | Default / mock tracker (for testing) |
Your license enables specific models:
COGNITIVE_LOAD_MODELDROWSINESS_MODELIn the SDK, the Cognitive Load capability is exposed under cog_load identifiers and Fatigue under drowsiness.
harmoneyes_theia.TheiaSDK(
license_key,
platform="PL",
)
| Parameter | Type | Default | Description |
|---|---|---|---|
| license_key | str | Required | Your SDK license key |
| platform | str | "PL" | Eye tracking platform ("PL", "WT") |
start_new_session(session_uuid, task_type)stop_processing()start_realtime_video()start_realtime_data()get_cog_load_levels()(levels_dict, batch_number) — levels_dict holds value (0 = low, 1 = moderate, 2 = high), label, and confidence.get_drowsiness_level()(drowsiness_dict, batch_number) — value (0–3), label, confidence.get_video_frame()has_connection_timeout()is_video_streaming()predict_cog_load_batch(data, n_jobs=1)predict_drowsiness_batch(data, timezone=None, prediction_stride=120, n_jobs=1)refine_cog_load_batch(data, refining_data, n_jobs=1)reset_models_batch()save_refined_model()reset_to_base_model()get_model_info()The SDK raises specific exceptions for error conditions:
LicenseValidationError: invalid license key format or tampered licenseLicenseExpiredError: license has expiredLicenseNetworkError: network issues when validating the licenseLicenseFeatureNotEntitledError: feature not enabled in the licensefrom harmoneyes_theia import (
LicenseValidationError,
LicenseExpiredError,
LicenseFeatureNotEntitledError,
)
try:
sdk = harmoneyes_theia.TheiaSDK(
license_key="your-license-key",
platform="PL",
)
except LicenseValidationError as e:
print(f"License validation failed: {e}")
except LicenseExpiredError as e:
print(f"License expired: {e}")