YOLO MCP 服务
强大的 YOLO(You Only Look Once)计算机视觉服务,通过模型上下文协议 (MCP) 与 Claude AI 集成。该服务使 Claude 能够使用最先进的 YOLO 模型执行对象检测、分割、分类和实时摄像头分析。
特征
物体检测、分割、分类和姿势估计
实时摄像头集成,用于活体物体检测
支持模型训练、验证和导出
结合多种模型的综合图像分析
支持文件路径和 base64 编码图像
与 Claude AI 无缝集成
设置说明
先决条件
Python 3.10 或更高版本
Git(可选,用于克隆存储库)
环境设置
为项目创建一个目录并导航到该目录:
mkdir yolo-mcp-service cd yolo-mcp-service下载项目文件或从存储库克隆:
# If you have the files, copy them to this directory # If using git: git clone https://github.com/GongRzhe/YOLO-MCP-Server.git .创建虚拟环境:
# On Windows python -m venv .venv # On macOS/Linux python3 -m venv .venv激活虚拟环境:
# On Windows .venv\Scripts\activate # On macOS/Linux source .venv/bin/activate运行安装脚本:
python setup.py安装脚本将:
检查你的 Python 版本
创建虚拟环境(如果尚未创建)
安装所需的依赖项
生成 MCP 配置文件 (mcp-config.json)
输出包括 Claude 在内的不同 MCP 客户端的配置信息
请注意安装脚本的输出,它类似于:
MCP configuration has been written to: /path/to/mcp-config.json MCP configuration for Cursor: /path/to/.venv/bin/python /path/to/server.py MCP configuration for Windsurf/Claude Desktop: { "mcpServers": { "yolo-service": { "command": "/path/to/.venv/bin/python", "args": [ "/path/to/server.py" ], "env": { "PYTHONPATH": "/path/to" } } } } To use with Claude Desktop, merge this configuration into: /path/to/claude_desktop_config.json
下载 YOLO 模型
在使用该服务之前,您需要下载 YOLO 模型。该服务会在以下目录中查找模型:
服务运行的当前目录
models子目录server.py 中的
CONFIG["model_dirs"]变量配置的任何其他目录
创建models目录,下载一些常用的模型:
对于 Windows PowerShell 用户:
配置 Claude
要与 Claude 一起使用此服务:
对于 Claude web:在本地机器上设置服务并使用 MCP 客户端中的安装脚本提供的配置。
对于 Claude 桌面:
运行安装脚本并记下配置输出
找到您的 Claude Desktop 配置文件(路径在安装脚本输出中提供)
将配置添加或合并到您的 Claude Desktop 配置文件中
重启Claude桌面
在 Claude 中使用 YOLO 工具
1. 首先检查可用的模型
请务必先检查您的系统上有哪些型号可用:
2. 检测图像中的物体
要分析计算机上的图像文件:
您还可以指定不同的模型:
3. 运行综合图像分析
对于结合对象检测、分类等的更详细分析:
4.图像分割
用于识别对象边界和创建分割蒙版:
5.图像分类
对整个图像内容进行分类:
6. 使用电脑的摄像头
使用计算机的摄像头开始实时物体检测:
获取最新的相机检测结果:
完成后停止相机:
7. 高级模型操作
训练自定义模型
验证模型
将模型导出为不同格式
8.测试连接
检查YOLO服务是否正常运行:
故障排除
相机问题
如果相机不工作,请尝试不同的相机 ID:
未找到模型
如果未找到模型,请确保已将其下载到配置的目录之一:
性能问题
为了在有限的资源下获得更好的性能,请使用较小的模型(例如,yolov8n.pt 而不是 yolov8x.pt)
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一项计算机视觉服务,允许 Claude 使用最先进的 YOLO 模型执行对象检测、分割、分类和实时摄像头分析。
Related MCP Servers
- Asecurity-licenseAqualityThe server facilitates natural language interactions for exploring and understanding codebases, providing insights into data models and system architecture using a cost-effective, simple setup with support for existing Claude Pro subscriptions.Last updated -420
- -security-license-qualityA comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.Last updated -39MIT License
- -security-license-qualityProvides Claude with real-time system monitoring capabilities, including CPU, memory, disk, network, battery, and internet speed metrics.Last updated -1MIT License
- -security-license-qualityProvides AI-powered visual analysis capabilities for Claude and other MCP-compatible AI assistants, allowing them to capture and analyze screenshots, perform file operations, and generate UI/UX reports.