smolvlm について
smolvlmは、Apple Silicon上でSmolVLM-2Bを使って画像をローカル分析するスキルです。画像の説明や質問応答、OCR、UIやコードのスクリーンショット分析に対応します。
主な機能
- 01SmolVLM-2Bによる画像のローカル分析
- 02画像の説明と視覚的な質問応答
- 03OCRとスクリーンショットの文字抽出
- 04UIとコードのスクリーンショット分析
- 05PNG、JPG、GIF、WebPに対応
活用シーン
- 01ローカル写真の説明
- 02スクリーンショットからの文字抽出
- 03UIのコントロールと状態の確認
- 04画像内のコードやエラーの特定
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ tdimino/ claude-code-minoan --skill smolvlmインストール後、Claude Code で/smolvlmを入力して読み込まれたか確認します。
同梱ファイルREADME.mdscripts/view_image.py
詳細
SmolVLM - ローカル画像分析
mlx-vlm を使って Apple Silicon 向けに最適化された、最先端のコンパクトな視覚言語モデル SmolVLM-2B で画像をローカルに分析します。
クイック使用方法
画像を説明する
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
トラブルシューティング
「Model not found」:初回実行時にモデル(約4GB)がダウンロードされます。完了するまでお待ちください。
メモリ不足:ほかのアプリケーションを終了してください。モデルには約6GBの空き RAM が必要です。
初回の推論が遅い:初回使用時のモデル読み込みには10~15秒かかります。2回目以降の呼び出しはより速くなります。
コメント
Markdown 対応