AG-MCXH(中文:明察芯毫)是一个基于大语言模型的视觉智能体框架,能够根据自然语言指令自动选择并调用多种视觉工具对图像进行分析和处理。该框架支持目标检测、图像分割、姿态估计、OCR等多种视觉任务。
- 🤖 智能工具选择: 基于自然语言指令自动选择最合适的视觉工具
- 🔧 丰富的视觉工具: 内置多种视觉处理工具,包括目标检测、图像分割等
- 🧠 大模型集成: 集成vLLM推理引擎,支持高性能推理
- 🌐 Web界面: 提供友好的Web用户界面
- 📦 模块化设计: 易于扩展的模型和工具注册机制
- YOLOv5/YOLOv8: 实时目标检测工具
- SegmentAnything (SAM): 通用图像分割工具
- SegmentObject: 特定对象分割工具
- OCR: 光学字符识别
- VQA: 视觉问答
- 人体姿态估计
- 人脸关键点检测
- Canny边缘检测
- 深度图生成
- 涂鸦草图生成
- Python 3.8+
- CUDA 11.8+ (用于GPU加速,可选)
git clone https://github.com/How-do-you-feel/Agent_MCXH.git
cd Agent_MCXH
pip install -r requirements.txtYOLO模型文件 SAM模型文件 大语言模型(如Qwen2.5系列
from ag_mcxh.apis import load_tool
# 加载YOLO检测工具
yolo_tool = load_tool('YoloDetect',
model_path='/path/to/yolo11n.pt',
device='cpu',
conf_threshold=0.5)
# 处理图像
from ag_mcxh.types import ImageIO
image = ImageIO('/path/to/image.jpg')
detection_results = yolo_tool.apply(image)
print(detection_results)在ag_mcxh/models/目录下创建模型实现,并通过装饰器或加载器函数注册到模型注册表。
在ag_mcxh/tools/目录下创建工具实现,继承BaseTool类并通过装饰器注册。
查看ag_mcxh/examples/目录中的示例代码:
example_yolo.py: YOLO目标检测示例vision_agent_example.py: 视觉智能体使用示例model_registration_example.py: 模型注册示例
Agent_MCXH/
├── ag_mcxh/ # 核心框架代码
│ ├── agent/ # 智能体实现
│ ├── apis/ # API接口
│ ├── models/ # 模型注册和管理
│ ├── tools/ # 视觉工具实现
│ ├── types/ # 数据类型定义
│ ├── utils/ # 工具函数
│ └── examples/ # 使用示例
├── webui/ # Web界面
├── scripts/ # 脚本工具
└── pics/ # 图片资源
欢迎提交Issue和Pull Request来改进本项目。