Common components for building Starwit Awareness Engine (SAE) stages in Python. See the repository overview for the bigger picture.
The package is not published to PyPI; install it directly from the Git repository, pinned to a release tag.
poetry add git+https://github.com/starwit/[email protected]#subdirectory=python
# or
pip install "git+https://github.com/starwit/[email protected]#subdirectory=python"visionlib.pipeline– moveSaeMessageprotobufs through Valkey streams:ValkeyConsumer– read messages from one or more streams.ValkeyPublisher– write messages to a stream;ValkeyPipelinePublisherbatches writes into one round-trip.get_raw_frame_data– extract a video frame as a numpy array (JPEG decoded transparently).formats– validateSaeMessage/PositionMessageobjects.settings– YAML config source and log-level enum forpydantic-settings.
visionlib.saedump– read.saedumprecordings (see the format specification).
Activate the environment and run pytest. Tests spin up a Valkey instance via testcontainers, so a working Docker installation is required.
If you see weird docker errors, it is probably because you are running rootless Docker
(see this issue).
Make sure DOCKER_HOST points at the correct socket:
export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock- Restrict pyturbojpeg to 1.x (2.x requires libjpeg-turbo 3.x, which is not available on Ubuntu 24.04 LTS)
- Migrate from redis-py to valkey-py
- Use
valkey-py>=6.1.1 - Breaks compatibility: imports and constructor calls for consumer and publisher must be changed!
- Use
- Provide cleaner imports (
from visionlib.pipeline import ValkeyConsumer)