Skip to main content

SpatialAI SDK

Python SDK for VisionLibra ToF depth sensors and cameras.

Physical AI starts with Spatial Intelligence + AI Agents.

pip install spatialai

Five lines to spatial intelligence:

from spatialai import Camera

cam = Camera()
result = cam.detect_people()
print(result)
# {'people': 1, 'nearest_m': 1.42, 'positions': [...], 'source': 'simulator'}

Status — v0.1 (alpha)

Feature Status
Simulator (all four products, no hardware needed) ✅ works everywhere
Spatial Mini / DM0301 over I²C (VL53L4CD-compatible) ✅ Raspberry Pi & Linux SBCs, via pip install spatialai[dm0301]
Spatial Home / Vision / Robot real backends 🚧 in development — simulator only for now
Model marketplace, agents, fleet 🚧 in development

Simulator — works on any machine

Every device can run in simulator mode, which generates realistic distance and people-detection streams. It is the default whenever no hardware is detected, so the quickstart above always runs.

from spatialai import Camera

cam = Camera("spatial-vision", simulate=True)
for frame in cam.stream(hz=10, duration=3):
    print(f"people={frame.people} nearest={frame.nearest_m:.2f}m")

Try it from the terminal:

spatialai demo                  # live simulated distance readout
spatialai demo --device spatial-vision
spatialai scan                  # look for real hardware on I2C

Real hardware — Spatial Mini (DM0301)

The DM0301 1D ToF sensor is pin-to-pin compatible with the ST VL53L4CD, so the SDK drives it through the proven Adafruit driver stack.

Wiring (Raspberry Pi): VIN→3V3, GND→GND, SDA→GPIO2, SCL→GPIO3 (I²C address 0x29).

sudo raspi-config          # enable I2C
pip install "spatialai[dm0301]"
from spatialai import Sensor

lock = Sensor("spatial-mini")      # auto-detects the sensor on I2C
print(lock.distance_m())           # 0.734

for reading in lock.stream(hz=20):
    if reading.distance_m < 0.5:
        print("presence!", reading)

Camera("spatial-mini").detect_people() also works on real hardware: it maps near-field presence onto the people-detection schema (0 or 1 person).

API overview

  • Camera(device_id=None, simulate=None) — unified entry point. .detect_people(), .stream(hz, duration), .distance_m(), .info()
  • Sensor(device_id) — alias of Camera tuned for 1D sensors.
  • spatialai.devices() — catalog of supported products.
  • Exceptions: DeviceNotFound, HardwareNotSupportedYet.

Roadmap

Depth-frame backends for Spatial Home (DMOS5030A serial), Spatial Vision (DMOM2508CL) and Spatial Robot (DMAS2M001), on-device people tracking models, and the agent/fleet APIs. Follow along at visionlibra.adamaohappy.workers.dev/developer.html.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spatialai-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

spatialai-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file spatialai-0.1.0.tar.gz.

File metadata

  • Download URL: spatialai-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for spatialai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a139ee866b8c249f95fa33387b390ffa6408c6a7d04d80f9d2b9532cfd3be574
MD5 acb657035c5f1f95f353bb0e4a6c1991
BLAKE2b-256 e0c195781e659c1ce0caf6f18b35b9c00bd2b7bd636ef83a3a8479c2126c3469

See more details on using hashes here.

File details

Details for the file spatialai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spatialai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for spatialai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb221976c8adc66e765aca2993f30539dbd15da9d9d1291b58802c31febdf953
MD5 8923684006221f647a549f2909e674c1
BLAKE2b-256 ce5d4c852dfa8f4c41a4417dd3525272da58320bc7472ae7a093eab7ecadd7bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page