@gutenye/ocr-node

中文文档
1.4.9发布于 2026/09/19MITES Module近 30 天下载 9万

Guten OCR是一个高精度的文本检测(OCR)Javascript/Typescript库,运行于Node.js,浏览器,React Introduct和C++上. 基于 PaddleOCR 和 ONNX 运行时间

中文使用文档
文档目录9 节
  1. 开始
  2. 节点
  3. 浏览器
  4. 原生反应
  5. C++ 组合
  6. API 参考
  7. 发展
  8. 相关项目
  9. 许可证

古腾 OCR

演示 | 路线图

oCR Javascript 库运行于 Node.js, 浏览器, React Introduct 和 C++

依据 弹出 财务报告和审定财务报表 ONNX 运行时间,支持 PP-OCRv4 模式

开始

节点

示例

bun add @gutenye/ocr-node
import Ocr from '@gutenye/ocr-node'
const ocr = await Ocr.create()
const result = await ocr.detect('a.jpg')

浏览器

示例

bun add @gutenye/ocr-browser
import Ocr from '@gutenye/ocr-browser'
const ocr = await Ocr.create({
  models: {
    detectionPath: '/assets/ch_PP-OCRv4_det_infer.onnx',
    recognitionPath: '/assets/ch_PP-OCRv4_rec_infer.onnx',
    dictionaryPath: '/assets/ppocr_keys_v1.txt'
  }
})
const result = await ocr.detect('/a.jpg')

原生反应

示例

bun add @gutenye/ocr-react-native
import Ocr from '@gutenye/ocr-react-native'
const ocr = await Ocr.create()
const result = await ocr.detect('a.jpg')

C++ 组合

示例

#include "native-ocr.h"
NativeOcr* ocr = new NativeOcr(..)
auto result = ocr->detect("a.jpg");

API 参考

Ocr.create({
  models?: {
    detectionPath: string
    recognitionPath: string
    dictionaryPath: string
  },
  isDebug?: boolean
  debugOutputDir?: string // Node only
  recognitionImageMaxSize?: number // RN only
  detectionThreshold?: number // RN only
  detectionBoxThreshold?: number // RN only
  detectionUnclipRatiop?: number // RN only
  detectionUseDilate?: boolean // RN only
  detectionUsePolygonScore?: boolean // RN only
  useDirectionClassify?: boolean // RN only
  onnxOptions?: {}       // Node only. Pass to ONNX Runtime
}): Promise<Ocr>

ocr.detect(imagePath: string | {data: Uint8Array | Uint8ClampedArray | Buffer, width: number, height: number}, {
  onnxOptions?: {}     // Node only. Pass to ONNX Runtime
}): Promise<{texts: TextLine[], resizedImageWidth: number, resizedImageHeight: number}>

TextLine {
  text: string
  score: number
  frame: { top, left, width, height }
}

发展

  • 需要 Git LFS 来克隆 repo
brew install git-lfs 
git clone [email protected]:gutenye/ocr.git
名称平台说明
电子搜索-OCR电子
相接桨节点复算部分不完整
欧克雷斯节点复算部分不完整
划板- 点- 点移动, C++

许可证

这个项目的源代码根据 麻省理工学院 执照.

模型和字典资产 packages/models/assets 为: 没有 麻省理工学院的执照 他们来自 弹出 并一直处于 阿帕奇 - 2.0 执照.

版本与发布记录

@gutenye/ocr-node 共发布 18 个版本,首次发布于 2024/05/01;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.4.9latest2026/09/191 个月前
1.4.82024/12/131.9 年前
1.4.72024/12/042 年前
1.4.42024/07/092 年前
1.4.12024/05/202 年前
1.4.02024/05/202 年前

关于 @gutenye/ocr-node 的常见问题

@gutenye/ocr-node 是什么?

Guten OCR是一个高精度的文本检测(OCR)Javascript/Typescript库,运行于Node.js,浏览器,React Introduct和C++上. 基于 PaddleOCR 和 ONNX 运行时间

如何安装 @gutenye/ocr-node?

在项目目录运行 npm install @gutenye/ocr-node,或使用 pnpm add / yarn add / bun add。

@gutenye/ocr-node 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/gutenye__ocr-node 是否存在。

@gutenye/ocr-node 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@gutenye/ocr-node 可以商用吗?

@gutenye/ocr-node 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gutenye/ocr-node 的下载量有多少?

根据 npm 官方下载统计,@gutenye/ocr-node 在 2026/10/17 – 2026/11/15 这 30 天内被下载 89,566 次,日均约 2,986 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gutenye/ocr-node 还在维护吗?

最新版本 1.4.9 发布于 2026/09/19(1 个月前);至今共发布 18 个版本,其中过去 12 个月发布了 1 个;首次发布于 2024/05/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。