近期 PaddlePaddle 团队发布了最新的 PaddleOCR 模型 —— PP-OCRv6。该模型系列包含 tiny(1.5M 参数)、small(7.7M 参数) 和 medium(34.5M 参数) 3 个版本。
![]()
在 PaddleOCR 内部的多场景 OCR 基准测试中,PP-OCRv6_medium 的检测 Hmean 达到 86.2%,识别准确率达到 83.2%。此模型在对应 OCR 指标上超过了 Qwen3-VL-235B、Gemini-3.1-Pro 和 GPT-5.5 等多个大型视觉语言模型。
![]()
PP-OCRv6 特点
支持 50 种语言,包含简体中文、繁体中文、英语、日语以及 46 种使用拉丁字母的语言。
支持高精度文字检测与识别,能够应对复杂背景、小字、密集文字、旋转文字和低清晰度文字的场景。
轻量化、低成本部署,相比大型视觉语言模型,PP-OCRv6 参数更少、推理成本更低、响应速度更快。
支持 Paddle Inference、ONNX Runtime、Hugging Face Transformers 等推理方式。
你也可以上传包含表格的图片,识别成功后,能导出 HTML、XLSX、CSV 和 Markdown 等多种格式。
本地部署
PP-OCRv6 官方文档已经详细介绍了如何基于 PaddleOCR 和 Transformer 运行该模型,接下来我将介绍在 macOS 下,使用 ppu-paddle-ocr SDK 在本地部署 PP-OCRv6 模型。该 SDK 支持 Node.js、Bun、Deno、Browser 和 React Native 等多种平台。
创建项目
mkdir paddleocr-v6
cd paddleocr-v6
npm init -y
安装依赖
pnpm add ppu-paddle-ocr onnxruntime-web # Browser
pnpm add ppu-paddle-ocr onnxruntime-node # Node or Bun
运行 PP-OCRv6 模型
import { readFileSync } from"node:fs";
import { PaddleOcrService } from"ppu-paddle-ocr";
const service = new PaddleOcrService({
debugging: {
debug: false,
verbose: true,
},
});
asyncfunctionmain {
await service.initialize;
try {
const image = readFileSync("./assets/pp-ocrv6-models.jpg");
const imageBuffer = image.buffer.slice(
image.byteOffset,
image.byteOffset + image.byteLength,
);
const result = await service.recognize(imageBuffer);
console.log(result.text);
} finally {
await service.destroy;
}
}main.catch((error) => {
console.error(error);
process.exitCode = 1;
});
以上示例用于在 Node.js 或 Bun 中执行文字识别。如果你想要在浏览器环境中,运行文字识别。则需要使用 ppu-paddle-ocr/web 导出的 PaddleOcrService。
import { PaddleOcrService } from"ppu-paddle-ocr/web";
const service = new PaddleOcrService;
await service.initialize;
const file = document.getElementById("upload").files[0];
const img = new Image;
img.src = URL.createObjectURL(file);
awaitnewPromise((r) => (img.onload = r));
const canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
canvas.getContext("2d").drawImage(img, 0, 0);const result = await service.recognize(canvas);
console.log(result.text);
此外,ppu-paddle-ocr SDK 除了支持最新的 PP-OCRv6 模型之外,还支持 PaddleOCR 早期版本的 v5、v4 等模型。
总结
PP-OCRv6 提供了 3 种不同的模型,让我们可以根据实际的使用场景选择不同的模型。而且 3 个模型都很轻量,可以基于 Onnx Runtime 可以运行在手机等终端设备上。如果测试完 PP-OCRv6 模型后,不能满足你的需求,你可以继续测试一下,PaddleOCR-VL-1.6 和 模型。
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.