Skip to main content

ImprintX Tactile SDK

Unified Python SDK for ImprintX tactile devices:

  • imprintx.glove: Touch Glove 5-channel tactile glove SDK.
  • imprintx.sensor: Single-channel tactile sensor SDK (reserved for future devices).

Powered by a native Rust core with high-efficiency PyO3 bindings.

What's New in 0.2.4

  • 适配最新版硬件底板的左右手通道映射。
  • 新增五指通道同步输出。
  • show_gui() 启动数据流前读取 SN,并支持 USB 拔插后自动恢复视频流。
  • 补充 OpenCV 运行时依赖,pip install imprintx 会自动安装 GUI 所需依赖。

⚡ Quick Start

Installation

pip install imprintx

This installs the Python runtime dependencies used by the high-level APIs, including NumPy and OpenCV. CUDA inference additionally requires a compatible NVIDIA driver, CUDA runtime, and cuDNN; ROS 2 integration requires a separately installed ROS 2 environment.

High-Level One-Line Glove APIs 🚀

from imprintx import glove

# 1. 实时流式控制台输出
glove.stream()

# 2. GUI 网格图形界面展示(支持模型推理与 'b' 键实时去皮标定)
glove.show_gui(model="dense_3ch.onnx", device="cuda")

# 3. 抓取并保存 5 通道快照图片
glove.save_image(output_dir="./snapshots")

# 4. 录制 H.265 MP4 视频与微秒级时间戳 JSON
glove.record_video(output_path="recording.mp4", duration=5.0)

📖 Submodule APIs (imprintx.glove)

You can import directly via from imprintx.glove import ... or import imprintx.glove as glove:

from imprintx.glove import TouchGlove, stream, show_gui, save_image, record_video, list_ports

1. High-Level Functions

  • glove.stream(port=None, callback=None, duration=None): Connects to device and streams real-time tactile data to console or custom callback function.

  • glove.show_gui(port=None, model=None, device="auto", auto_reconnect=True): Opens an OpenCV 2x3 grid window displaying 5-channel real-time tactile images, displacement, and force fields. The device SN is read before streaming so channels are mapped to the logical finger order for the detected left/right hand. If the glove is unplugged and reconnected, the GUI keeps running and automatically restores the stream. Press 'q' to exit or 'b' to calibrate zero point.

  • glove.save_image(port=None, output_dir=".", prefix="tactile", save_grid=True): Captures a 5-channel tactile snapshot and saves channel images (*_ch0.png ... *_ch4.png) and a combined grid image (*_grid.png) to output_dir.

  • glove.record_video(port=None, output_path="output_h265.mp4", duration=5.0, fps=30.0): Records 5-channel H.265 grid video and exports microsecond-level aligned timestamp JSON metadata.

  • glove.list_ports(): Scans and returns a list of available serial port paths.

  • glove.load_video_timestamps(path: str): Loads and parses recorded video timestamp metadata from .json files.


2. Core API (TouchGlove Class)

For custom control loops and fine-grained integration:

from imprintx.glove import TouchGlove, list_ports
import time

ports = list_ports()
with TouchGlove(port=ports[0]) as g:
    print("Device SN:", g.get_sn())
    g.sync_rtc()  # Synchronize host clock with hardware RTC
    g.start()

    while True:
        batch = g.poll()
        for frame in batch:
            print(f"Ch {frame.channel} | Seq: {frame.seq_id} | Timestamp: {frame.timestamp_us} us | Image: {frame.image.shape}")
        time.sleep(0.01)

TouchGlove Methods

  • glove.open(port) / glove.close(): Connection management.
  • glove.start() / glove.stop(): Streaming control.
  • glove.poll() -> FrameBatch: Fetch latest 5-channel frame batch.
  • glove.calibrate_baseline(duration_sec=1.0): Recalibrate zero point.
  • glove.get_dense_fields(): Get 5-channel 3D displacement/force fields (5, 32, 32, 3).
  • glove.get_sn() / glove.set_sn(sn): Read / write hardware serial number.
  • glove.sync_rtc() / glove.query_rtc(): RTC clock synchronization.
  • glove.start_recording(output_path) / glove.stop_recording(): Video recording control.

📜 License

Proprietary / All Rights Reserved.

Metadata

Release files for imprintx 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imprintx 0.2.4
File Size Uploaded Provenance Actions
imprintx-0.2.4.tar.gz 70.3 kB Without provenance Details for imprintx-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for imprintx 0.2.4
File Interpreter ABI Platform Actions
imprintx-0.2.4-cp38-abi3-manylinux_2_34_x86_64.whl CPython 3.8 abi3 Linux glibc 2.34+ x86-64 Details for imprintx-0.2.4-cp38-abi3-manylinux_2_34_x86_64.whl

Total release size: 57.3 MB

Release files / imprintx-0.2.4.tar.gz

Download URL imprintx-0.2.4.tar.gz
Size 70.3 kB
Tags Source
SHA-256 checksum
How to use checksums
86ac3c47dbc9bf226ef8a4daa576a3aef06cf74c75c4bca91fd514ae4c838c35
BLAKE2b-256 checksum
How to use checksums
ae16c936f7a23ca6cd3774dc1c4a2b33966e6abc8756521a7eeac73f1ebfd688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / imprintx-0.2.4-cp38-abi3-manylinux_2_34_x86_64.whl

Download URL imprintx-0.2.4-cp38-abi3-manylinux_2_34_x86_64.whl
Size 57.2 MB
Tags CPython 3.8 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
81832fa2946f571d9ee55ed99cc1506bf9a7b4483a08a5f0fa9a2ef090f12f69
BLAKE2b-256 checksum
How to use checksums
8609919230c5526303c487198adc035df983d136b2a59f666cad1fcdfab3d3f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for imprintx 0.2.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page