Skip to main content

EZAI - 简单易用的AI机器人控制库

PyPI version Python versions License: MIT

EZAI是一个专为Go2机器狗和AI应用设计的简化Python接口库,让机器人控制和计算机视觉变得简单易用。

🚀 特性

  • 简单易用: 专为初学者设计的API接口
  • 模块化设计: 支持按需导入,减少依赖
  • Go2机器狗控制: 完整的运动控制和视频流支持
  • 计算机视觉: 集成OpenCV,支持图像处理和显示
  • AI工作流: 支持ONNX和RKNN模型推理
  • 教育友好: 适合STEM教育和编程学习

📦 安装

基础安装

pip install ezai-go2

完整安装(包含所有可选依赖)

pip install ezai-go2[all]

仅安装ONNX支持

pip install ezai-go2[onnx]

仅安装RKNN支持

pip install ezai-go2[rknn]

🔧 Go2 SDK安装

要使用Go2机器狗控制功能,需要额外安装unitree-sdk2py:

# 从官方源码安装
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
pip install -e .

📖 快速开始

Go2机器狗控制

from ezai import Go2

# 创建Go2控制器
dog = Go2()

# 连接机器狗
if dog.connect():
    # 前进
    dog.move(0.5, 0, 0)  # vx=0.5, vy=0, vyaw=0
    time.sleep(2)
    
    # 停止
    dog.move(0, 0, 0)
    
    # 断开连接
    dog.disconnect()

计算机视觉

from ezai import Camera, OpenCVUI

# 创建摄像头
camera = Camera()
ui = OpenCVUI()

# 捕获图像
image = camera.capture()
if image is not None:
    # 显示图像
    ui.show_image("Camera", image)
    ui.waitKey(0)

AI推理(ONNX)

from ezai import ONNXWorkflow

# 创建ONNX工作流
workflow = ONNXWorkflow("model.onnx")

# 加载图像
image = cv2.imread("test.jpg")

# 运行推理
result = workflow.run(image)
print(f"推理结果: {result}")

📚 模块说明

Go2模块

  • Go2: Go2机器狗主控制类
  • 支持运动控制、状态查询、视频流等
  • 自动网络接口检测和IP配置

Camera模块

  • Camera: 摄像头控制类
  • 支持USB摄像头和网络摄像头
  • 简化的图像捕获接口

UI模块

  • OpenCVUI: OpenCV显示界面类
  • 简化的图像显示和交互接口
  • 支持窗口管理和事件处理

AI工作流模块

  • ONNXWorkflow: ONNX模型推理
  • RKNNWorkflow: RKNN模型推理
  • 统一的推理接口设计

🛠️ 开发

安装开发依赖

pip install ezai-go2[dev]

运行测试

pytest tests/

代码格式化

black ezai/

📋 依赖要求

  • Python >= 3.7
  • OpenCV >= 4.5.0
  • NumPy <= 1.24.3
  • Pillow >= 8.0.0
  • netifaces >= 0.10.0

可选依赖:

  • unitree-sdk2py (Go2控制)
  • onnx + onnxruntime (ONNX推理)
  • rknn-toolkit2 (RKNN推理)

🤝 贡献

欢迎提交Issue和Pull Request!

📄 许可证

本项目采用MIT许可证 - 详见 LICENSE 文件

📞 联系方式

🙏 致谢

感谢Unitree机器人提供的Go2 SDK支持!

Metadata

Release files for ezai-go2 1.3.1

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

Source distribution (sdist)

Source distribution for ezai-go2 1.3.1
File Size Uploaded Provenance Actions
ezai_go2-1.3.1.tar.gz 52.6 kB Without provenance Details for ezai_go2-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ezai-go2 1.3.1
File Interpreter ABI Platform Actions
ezai_go2-1.3.1-py3-none-any.whl Python 3 none any Details for ezai_go2-1.3.1-py3-none-any.whl

Total release size: 76.8 kB

Release files / ezai_go2-1.3.1.tar.gz

Download URL ezai_go2-1.3.1.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7c7873d5981f10f54c2f082f1d2fb8c852715377786c3990c5726c586a134d26
BLAKE2b-256 checksum
How to use checksums
6c210eab8e99ef4bc85b52bca99428f75cc99a04ddd327629859437ce733fd39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.6

Release files / ezai_go2-1.3.1-py3-none-any.whl

Download URL ezai_go2-1.3.1-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4585b72b7c095246462bc63b6ad373d2f6f958b601e450c0c8ed1c890747476f
BLAKE2b-256 checksum
How to use checksums
f35df1d05140e2757e04859044686967024acafd94c266267edab3c64a3669f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.6

Security for ezai-go2 1.3.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.

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