GLM-OCR Skill (本地部署)
基于 Ollama 运行的 glm-ocr 模型,纯本地 OCR 工具,无需网络。
已安装
- 模型:
glm-ocr(通过ollama pull glm-ocr安装) - 大小: 2.2 GB
- 状态: 已下载并可用
使用方法
命令行
ollama run glm-ocr "Text Recognition: /path/to/image.png"
Python API
import subprocess
result = subprocess.run(
["ollama", "run", "glm-ocr", f"Text Recognition: {image_path}"],
capture_output=True, text=True
)
print(result.stdout)
示例
# 测试
ollama run glm-ocr "Text Recognition: /tmp/test-ocr.png"
# 你的实际图片
ollama run glm-ocr "Text Recognition: ~/Downloads/screenshot.png"
注意事项
- 首次运行需要加载模型(约 2.2 GB)
- MacBook Air M 系列可以流畅运行
- 支持中英文混合、代码、文档图片