mcpField
S
smolvlm

smolvlm

github.com/tdimino创意与媒体4155 次安装1 周前更新
代码仓库

关于 smolvlm

smolvlm 是一项使用 SmolVLM-2B 在 Apple Silicon 上本地分析图像的技能,支持图像描述、视觉问答、OCR,以及界面或代码截图分析。

主要功能

  1. 01使用 SmolVLM-2B 本地图像分析
  2. 02图像描述与视觉问答
  3. 03OCR 和截图文字提取
  4. 04界面与代码截图分析
  5. 05支持 PNG、JPG、GIF 和 WebP

适用场景

  1. 01描述本地存储的照片
  2. 02提取截图中的文字
  3. 03检查界面控件和状态
  4. 04识别图像中的代码或错误

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/tdimino/claude-code-minoan --skill smolvlm

安装后在 Claude Code 中输入/smolvlm确认已加载。

附带文件README.mdscripts/view_image.py

详细介绍

SmolVLM - 本地图像分析

使用 SmolVLM-2B 在本地分析图像。这是一款先进的小型视觉语言模型,通过 mlx-vlm 针对 Apple Silicon 进行了优化。

快速使用

描述图像
python ~/.claude/skills/smolvlm/scripts/view_image.py /path/to/image.png
询问有关图像的问题
python ~/.claude/skills/smolvlm/scripts/view_image.py /path/to/image.png "What text is visible?"
特定任务
# Extract text (OCR)
python ~/.claude/skills/smolvlm/scripts/view_image.py screenshot.png "Extract all text"

# UI analysis
python ~/.claude/skills/smolvlm/scripts/view_image.py ui.png "Describe the UI elements"

# Detailed description
python ~/.claude/skills/smolvlm/scripts/view_image.py photo.jpg --detailed

有效提示词

通用描述
  • "Describe this image" - 基本描述
  • "Describe this image in detail, including colors, composition, and any text" - 全面描述
文本提取(OCR)
  • "Extract all visible text from this image"
  • "What text appears in this screenshot?"
  • "Read the text in this document"
UI/屏幕截图分析
  • "Describe the user interface elements"
  • "What buttons and controls are visible?"
  • "Identify the application and its current state"
视觉问答
  • "How many [objects] are in this image?"
  • "What color is the [object]?"
  • "Is there a [object] in this image?"
代码/技术问题
  • "What programming language is shown?"
  • "Describe what this code does"
  • "Identify any errors in this code screenshot"

模型详情

规格值
模型SmolVLM-2B-Instruct
大小~4GB
峰值内存5.8GB
速度~94 tok/s(M 系列)
支持的格式PNG、JPG、JPEG、GIF、WebP

要求

  • 配备 Apple Silicon(M1/M2/M3)的 macOS
  • Python 3.10+
  • mlx-vlm 软件包:uv pip install mlx-vlm --system

故障排除

“未找到模型”:首次运行时会下载模型(约 4GB)。请等待下载完成。

内存不足:关闭其他应用程序。模型需要约 6GB 可用内存。

首次推理较慢:首次使用时,模型加载需要 10-15 秒;后续调用会更快。

评论

支持 Markdown