paddleocr-browser
v1.0.3
Published
PaddleOCR on browser
Downloads
313
Readme
paddleocr-browser
PaddleOCR running on browser using eSearch-OCR
Installation
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js"></script>
<script async src="https://docs.opencv.org/4.8.0/opencv.js" type="text/javascript"></script>
<script type="module">
import * as Paddle from "https://cdn.jsdelivr.net/npm/[email protected]/dist/esearch-ocr.js";
window.Paddle = Paddle;
</script>
Usage
const assetsPath = "https://cdn.jsdelivr.net/npm/paddleocr-browser/dist/";
const res = await fetch(assetsPath+"ppocr_keys_v1.txt");
const dic = await res.text();
await Paddle.init({
detPath: assetsPath+"ppocr_det.onnx",
recPath: assetsPath+"ppocr_rec.onnx",
dic: dic,
ort,
node: false,
cv:cv
});
let r = await Paddle.ocr(dataURL);