UNPKG

ppu-paddle-ocr

Version:

Lightweight, probably the fastest PaddleOCR SDK in TypeScript. Runs anywhere JavaScript runs: Node.js, Bun, Deno, mobile react-native, web browsers, and browser extensions. Docker & CLI supported. The official SDK is browser-only. Accurate text detection

16 lines (15 loc) 998 B
import * as ort from "onnxruntime-web"; import type { CanvasOps, CoreCanvas, PlatformProvider } from "../core/platform.js"; /** True when `navigator.gpu` is present and at least one adapter is available. */ export declare function isWebGpuAvailable(): Promise<boolean>; /** Returns `["webgpu", "wasm"]` when WebGPU is available, otherwise `["wasm"]`. */ export declare function getDefaultWebExecutionProviders(): Promise<ort.InferenceSession.SessionOptions["executionProviders"]>; export declare class WebPlatformProvider implements PlatformProvider<CoreCanvas> { readonly pathSeparator = "/"; readonly ort: PlatformProvider["ort"]; createCanvas(_width: number, _height: number): CoreCanvas; isCanvas(image: unknown): image is CoreCanvas; loadResource(source: string | ArrayBuffer | undefined, defaultUrl: string): Promise<ArrayBuffer>; saveDebugImage(_canvas: CoreCanvas, _filename: string, _outputDir: string): Promise<void>; readonly canvas: CanvasOps<CoreCanvas>; }