FlexML SDK¶
Get live vision, 3D pose, object maps and point clouds from the FlexML iPhone/iPad app into your robot, computer or microcontroller.
FlexML runs any Core ML vision model on the phone's camera, tracks objects in 3D with ARKit (and LiDAR where available), and streams the results over Wi-Fi or Bluetooth. This SDK is the open-source receiving side: a Python library and CLI, a ROS 2 bridge, ESP32 firmware examples, and the full data reference.
Get started What data can I get? Source on GitHub
Quick start¶
pip install "flexml-companion[all] @ git+https://github.com/Arjun-2005aa/FlexML_SDK.git#subdirectory=python"
flexml serve
- Put the phone and the computer on the same Wi-Fi.
- In FlexML, open Network Setup. It finds the computer automatically and connects.
- Tap Start Inference. Detections print in the terminal. Switch to AR for pose, mapped objects and the point cloud.
import asyncio
import flexml_companion as flexml
async def main():
async with flexml.Server() as phone:
await phone.wait_for_phone()
await phone.command("start_live", mode="ar")
async for msg in phone.messages():
if isinstance(msg, flexml.Inference):
for d in msg.detections:
print(d.track_id, d.label, f"{d.confidence:.0%}", d.center, d.distance)
asyncio.run(main())
Where to go next¶
| I want to… | Read |
|---|---|
| Connect a laptop, Pi or Jetson | Getting started, Python library |
| Know exactly which data exists (incl. the point cloud) | Data reference |
| Drive a robot, use an ESP32 or ROS 2 | Robot integration, Examples |
| Parse the messages myself | Stream protocol |
| Run my own model | Bring your own model, AI agent porting kit |
| Get ideas | What you can build |
Is the point cloud sent?¶
Yes: in AR mode, over WebSocket/HTTP (not UDP/Bluetooth), about once a second as incremental chunks. LiDAR devices give a dense coloured cloud. flexml serve --map room.ply saves it; flexml ros2 publishes it on /flexml/points. Details and troubleshooting: Data reference › The point cloud.
For AI coding agents¶
The repository's AGENTS.md explains the codebase, the data contract and the Python API to coding agents (Claude Code, Codex, Cursor, Copilot…).
Converting models¶
Use Apple's official coremltools to convert PyTorch, TensorFlow and Hugging Face models to Core ML, then check them with flexml check-model.