dshbase

Plugin directory / Developer / dsh-latex-ocr

dsh-latex-ocr

Verified · install-tested on dsh Yunnalab

✓ Actively maintained

View on GitHub ↗ ← Back to plugin directory

0Stars
0Forks
0Open issues
—Language
2026-08-17Last push
Cross-platformPlatform

What it does

A plugin in the Developer category for DeepSeek Harness.

✅
Our take
Works — verified, early-stage project

A plugin in the Developer category for DeepSeek Harness. It installs cleanly and boots without issues in our testing. It's early-stage but functional.

“Verified” means our automated CI actually ran dsh plugin add in a clean profile and it booted — nothing more. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

README

dsh-latex-ocr

公式图片 → LaTeX:为 DeepSeek Harness 提供 latex_ocr 工具,
把数学公式截图 / 教材公式页 / 手写公式照片识别为 LaTeX 代码(基于开源 pix2tex / LaTeX-OCR,
本地 CPU 推理,无需联网、无需 API key)。

安装

1. 安装识别引擎(一次性)

bash scripts/setup.sh      # 创建 ~/.dsh/latex-ocr-venv,安装 torch(CPU) + pix2tex

或手动:

python3 -m venv ~/.dsh/latex-ocr-venv
~/.dsh/latex-ocr-venv/bin/pip install --index-url https://download.pytorch.org/whl/cpu torch
~/.dsh/latex-ocr-venv/bin/pip install pix2tex
~/.dsh/latex-ocr-venv/bin/pip install --index-url https://download.pytorch.org/whl/cpu torchvision   # 与 torch 同源,避免算子不匹配

首次识别会自动下载模型权重(约 120MB,HuggingFace)。

NixOS:pip 安装的二进制缺少 libstdc++.so.6 / libz.so.1,setup.sh 会自动生成
注入 nix store 运行库的 pix2tex-dsh 包装脚本;插件优先使用它。

2. 安装插件

# 任意 DeepSeek Harness 检出目录
dsh plugin --profile web add dsh-latex-ocr        # npm 发布后可这样装
# 或本地源码:dsh plugin --profile web add /path/to/dsh-latex-ocr

重启 DSH Web 进程后生效。

使用

把这张公式识别成 LaTeX:latex_ocr(image="/path/to/formula.png")

返回 LaTeX 表达式,可直接用于讲解、推导与复现。本地 CPU 推理约 1-7 秒/条。

实测(温度 0.1):

原公式 识别结果
∫₀^∞ e^{-x²} dx = √π/2 \int_{0}^{\infty}e^{-x^{2}}\,d x={\frac{\sqrt{\pi}}{2}} ✅
lim_{x→0} sinx/x = 1 \operatorname*{lim}_{x\to0}{\frac{\sin x}{x}}=1 ✅

复杂公式(重积分、矩阵、求和上下限)可能不完美,关键公式请对照原图核对。

工作原理

latex_ocr 工具 → execFile 调用本机 pix2tex CLI(~/.dsh/latex-ocr-venv/bin/pix2tex[-dsh],
找不到则回退到 PATH 上的 pix2tex)→ 解析 stdout 中的 LaTeX。

兼容性

  • Node ≥ 22(DSH Web 要求)
  • Python ≥ 3.10(引擎;PyTorch 需支持对应版本)
  • 磁盘:约 1.5GB(torch + pix2tex + 权重)
  • 平台:Linux / macOS(Windows 未验证;scripts/setup.sh 为 bash)

License

MIT(pix2tex 模型与权重版权归其原作者所有)。

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-latex-ocr for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:Yunnalab/dsh-latex-ocr

Headless (CLI) profile:

dsh plugin --profile headless add github:Yunnalab/dsh-latex-ocr

Test report

Verified: L1 install + L2 load + L3 runtime from GitHub source on dsh 0.1.0-rc.6.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Developer

Browse all 7819 plugins →