@gutenye/ocr-node

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

Guten OCR is a high accurate text detection (OCR) Javascript/Typescript library that runs on Node.js, Browser, React Native and C++. Based on PaddleOCR and ONNX runtime

原始使用文档
文档目录9 节
  1. Getting Started
  2. Node
  3. Browser
  4. React Native
  5. C++
  6. API Reference
  7. Development
  8. Related Projects
  9. License

Guten OCR

Demo | Roadmap

an OCR Javascript library runs on Node.js, Browser, React Native and C++

Based on PaddleOCR and ONNX Runtime, supports PP-OCRv4 model

Getting Started

Node

Example

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

Browser

Example

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')

React Native

Example

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++

Example

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

API Reference

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 }
}

Development

  • Requires Git LFS to clone the repo
brew install git-lfs 
git clone [email protected]:gutenye/ocr.git
NamePlatformsNote
eSearch-OCRElectron
paddleocr-onnxNodeRecogination part is incomplete
ocrjsNodeRecogination part is incomplete
Paddle-Lite-DemoMobile, C++

License

The source code of this project is licensed under the MIT license.

The model and dictionary assets in packages/models/assets are not covered by the MIT license. They come from PaddleOCR and remain under its Apache-2.0 license.

版本与发布记录

@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 is a high accurate text detection (OCR) Javascript/Typescript library that runs on Node.js, Browser, React Native and C++. Based on PaddleOCR and ONNX runtime

如何安装 @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 和提交记录判断。