OpenZilo Gesture Studio & Python Recognition
Teach an OpenZilo ring your own gestures, then recognize them in your Python app.
中文 · Quick start · Workflow · Python API · Docs
Record a few repetitions of a gesture in the desktop app, train a model, and export it as a single file that your Python code can load.
Record → Train → Test live → Export *.gesture.json → Recognize in Python
Training and recognition run on your computer. Nothing is flashed or uploaded to the ring.
| Package | What it does | Needs |
|---|---|---|
openzilo-gesture-studio |
Desktop app for connecting, recording, training and testing, plus ring audio and device tools | OpenZilo SDK, PySide6, Bluetooth |
openzilo-gesture |
Loads an exported model and recognizes gestures | NumPy, SciPy and hmmlearn only |
Quick start
Both packages support Python 3.10+. Install uv and use a desktop session to run Studio.
From PyPI
uvx openzilo-gesture-studio
uv add openzilo-gesture
The first command opens Studio. Run the second command in your own uv project to add the Python recognition package.
From source
Clone the repository with Git:
git clone https://github.com/ziloai/OpenZilo-Gesture.git
cd OpenZilo-Gesture
uv sync --locked --all-packages
uv run --locked --all-packages openzilo-gesture-studio
The Studio interface is in Chinese, so the steps below give each label with a translation.
Train with sample data
You can train without a ring using sample_data/ from the repository. It has six gestures with five repetitions each at 25 Hz:
uv run --locked --package openzilo-gesture-studio openzilo-gesture-train --data sample_data --output exports/demo.gesture.json
uv run --locked python examples/recognize_export.py --bundle exports/demo.gesture.json --input "sample_data/向上.json"
This classifies the recordings it was trained on, so it shows that the pipeline works, not how accurate it is.
Platform requirements
- Bluetooth: a working adapter and permission to use it (BlueZ on Linux; allow your terminal or IDE on macOS).
- Linux Qt libraries: if Qt reports a missing library, run
sudo apt install libegl1 libgl1 libxkbcommon0 libdbus-1-3. - Audio: decoding audio files from the ring to WAV needs a system
ffmpeg. Without it, the raw.binis still saved. Gestures don't need it. - Firmware: the enhanced feature baseline is
V2.001.0002.0001. Studio enables features based on what the connected ring reports.
Workflow
1. Connect the ring
Scan and select your ring, or enter its address, then click 连接 (Connect). Rings you've connected to are remembered. Recording becomes available once fresh motion data arrives, and no gesture mode needs to be turned on.
2. Record a gesture
Enter a name, click 开始一次录制 (Start a take), perform the gesture once, then stop. Record at least 3 takes, ideally 5–10 or more, then click 保存 / 追加 (Save / Append).
Each take shows its waveform. If automatic cropping misses the gesture, turn on 手动框选 (Manual selection) and drag across the chart to mark it. This only adds an annotation; the raw recording is unchanged.
The same page imports existing JSON and CSV recordings and deletes saved gestures.
3. Train
Choose the preset that fits the gesture, then click 训练全部数据 (Train on all data):
- 短促动作 / 响指 (Short / Snap): snaps, taps and other brief impacts
- 连续动作 (Continuous): waves and other longer movements
With at least 4 takes per gesture, 留出评估 (Hold-out evaluation) tests on recordings left out of training. Changing the data or settings invalidates the model, so retrain afterwards.
4. Test it live
Turn on 实时试识别 (Live recognition). Start at rest and return to rest between gestures. Each recognized gesture is outlined on the chart with its name and confidence.
Also try everyday movements to see what triggers by mistake. Training only sees examples of your gestures, so it can't guarantee that other movements are rejected.
5. Export
On the training page, click 导出模型包 (Export model) to save a *.gesture.json file. It contains the gesture names, model parameters, and the filtering and segmentation settings, so your application doesn't have to reconfigure them.
Other Studio tools
|
录音 (Audio) Record remotely, stream live PCM with optional monitoring, auto-download recordings made with the ring's button, or fetch them from its history. |
设备工具 (Device tools) Run guided IMU calibration and signed firmware updates. Calibration stays on your computer and never affects gesture data. A firmware update requires a separately trusted public key, and 100% sent doesn't mean it's installed. |
|
关于 (About) Shows versions, repositories and contributors. Opening this page is the only time the app contacts GitHub, and it sends no device or gesture data. |
诊断 (Diagnostics) Shows acceleration magnitude and direction in real time. Readings include gravity, so they don't show movement direction. See how they're calculated. |
Use it in Python
Add the recognition package to your project. It doesn't install Studio, Qt or the Bluetooth SDK:
uv add /path/to/OpenZilo-Gesture
Classify one complete gesture, where samples is an (N, 6) array:
from openzilo_gesture import GestureRecognizer
recognizer = GestureRecognizer.load("demo.gesture.json")
print(recognizer.gesture_names, recognizer.sample_rate_hz)
result = recognizer.predict(samples, sample_rate_hz=25)
if result is not None: # None means too short or rejected
print(result.name, result.confidence, result.score)
Or feed a continuous stream from any source, such as the SDK, a serial port, a network or files:
for result in recognizer.feed(batch, sample_rate_hz=25): # may return several gestures
print(result.name, result.confidence)
recognizer.reset() # after a reconnect or repositioning the ring
Before you rely on the results
- Input format: columns are
ax, ay, az, gx, gy, gzin raw int16 units, not g or °/s. - Match training conditions:
sample_rate_hzonly checks the rate; it doesn't resample or configure the ring. Keep the sample rate, sensor range and how the ring is worn the same as in training. - Confidence isn't a probability: it's a relative score, and it's
Nonefor single-gesture models. - Single-gesture models:
feed()raises an error unless the model has rejection calibration, which needs at least 3 takes when training. - Measuring accuracy: use recordings from a separate session, and include movements that aren't your gestures.
- One recognizer per stream: recognizers keep state, so don't share one across threads or devices.
Documentation
| Topic | Document |
|---|---|
| Studio details: short gestures, rejection, audio, calibration, firmware updates (Chinese) | studio/README.zh-CN.md |
| Full API and export format (Chinese) | docs/architecture.md |
| SDK integration and firmware contract | docs/sdk.md |
Older tools
- Tkinter interface:
uv run --locked --all-packages openzilo-gesture-studio --ui legacy. This requires a Python with Tkinter. - Scripts:
record_gesture.py,train_hmm.pyandrecognize.pystill work. They use.pklmodels, which Studio andopenzilo-gesturedon't import, so retrain from your JSON recordings to get a*.gesture.json. Only load pickle files you trust, because loading one can run code.record_gesture.pyoverwrites recordings with the same name.
Development
uv run --locked --all-packages python -m unittest discover -s tests -v
uv build --all-packages --wheel
Commit uv.lock along with any dependency change. Tests don't use real Bluetooth hardware, so check device behavior on a real ring. Report problems in GitHub Issues.
License
MPL-2.0, covering the software, documentation, sample data, pretrained models and bundled assets. See NOTICE.md for dependencies and trademarks.
Metadata
Release files for openzilo-gesture 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openzilo_gesture-0.2.1.tar.gz | 126.9 kB | Without provenance | Details for openzilo_gesture-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openzilo_gesture-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for openzilo_gesture-0.2.1-py3-none-any.whl |
Total release size: 151.6 kB
Release files / openzilo_gesture-0.2.1.tar.gz
| Download URL | openzilo_gesture-0.2.1.tar.gz |
|---|---|
| Size | 126.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79c9d090d1776f17a032a0774504d13ed8c69bebdfe16ab7c58e6c1cad7302cf
|
|
BLAKE2b-256 checksum How to use checksums |
7865a38592267bd79a8c4ffe11d18b3f4b4c2cd617f3ae2eabea2c31aef8fc4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / openzilo_gesture-0.2.1-py3-none-any.whl
| Download URL | openzilo_gesture-0.2.1-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac73249ae4663b7ee00e0ece85ae0e861bdded149371f2356b15446659a157b6
|
|
BLAKE2b-256 checksum How to use checksums |
90841d975b4ffa31d38d45c3fb6ca793816a3158eb7e58f439bd4606c4fadda3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for openzilo-gesture 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.