forked from RapidAI/RapidOcrOnnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RapidOcrOnnx.d.cts
37 lines (31 loc) · 1.06 KB
/
RapidOcrOnnx.d.cts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
declare interface RapidOcrOnnx {
readonly version: string;
padding: number;
maxSideLen: number;
boxScoreThresh: number;
boxThresh: number;
unClipRatio: number;
doAngle: boolean;
mostAngle: boolean;
}
declare class RapidOcrOnnx {
constructor();
initModels(detModel: string, clsModel: string, recModel: string, keyPath: string): Promise<boolean>;
initModelsSync(detModel: string, clsModel: string, recModel: string, keyPath: string): boolean;
setNumThread(threads: number): void;
setGpuIndex(gpuIndex: number): void;
detect(buf: NodeJS.TypedArray): Promise<RapidOcrOnnx.Results>;
detect(path: string): Promise<RapidOcrOnnx.Results>;
detectSync(buf: NodeJS.TypedArray): RapidOcrOnnx.Results;
detectSync(path: string): RapidOcrOnnx.Results;
}
declare namespace RapidOcrOnnx {
interface Result {
text: string;
block: [[number, number], [number, number], [number, number], [number, number]];
score: number;
}
interface Results extends Array<Result> {
}
}
export = RapidOcrOnnx;