@voquill/web-ocr-models 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +39 -2
- package/assets/ch_PP-OCRv4_det_infer.onnx +0 -0
- package/assets/ch_PP-OCRv4_rec_infer.onnx +0 -0
- package/assets/ppocr_keys_v1.txt +6623 -0
- package/index.d.ts +13 -0
- package/index.js +14 -0
- package/package.json +29 -4
package/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** File names of the assets inside `assetsDir`. */
|
|
2
|
+
export declare const files: {
|
|
3
|
+
detection: 'ch_PP-OCRv4_det_infer.onnx'
|
|
4
|
+
recognition: 'ch_PP-OCRv4_rec_infer.onnx'
|
|
5
|
+
dictionary: 'ppocr_keys_v1.txt'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Absolute path of the directory that holds the assets. Node only, for build tooling that copies or serves them. */
|
|
9
|
+
export declare const assetsDir: string
|
|
10
|
+
|
|
11
|
+
export declare const detectionPath: string
|
|
12
|
+
export declare const recognitionPath: string
|
|
13
|
+
export declare const dictionaryPath: string
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
|
|
4
|
+
export const files = {
|
|
5
|
+
detection: 'ch_PP-OCRv4_det_infer.onnx',
|
|
6
|
+
recognition: 'ch_PP-OCRv4_rec_infer.onnx',
|
|
7
|
+
dictionary: 'ppocr_keys_v1.txt',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const assetsDir = path.join(path.dirname(fileURLToPath(import.meta.url)), 'assets')
|
|
11
|
+
|
|
12
|
+
export const detectionPath = path.join(assetsDir, files.detection)
|
|
13
|
+
export const recognitionPath = path.join(assetsDir, files.recognition)
|
|
14
|
+
export const dictionaryPath = path.join(assetsDir, files.dictionary)
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voquill/web-ocr-models",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "PaddleOCR PP-OCRv4 detection and recognition models in ONNX format, with the character dictionary, for @voquill/web-ocr.",
|
|
5
|
+
"keywords": ["ocr", "paddleocr", "onnx", "models"],
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/voquill/web-ocr.git",
|
|
11
|
+
"directory": "packages/web-ocr-models"
|
|
12
|
+
},
|
|
13
|
+
"main": "./index.js",
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"default": "./index.js"
|
|
19
|
+
},
|
|
20
|
+
"./assets/*": "./assets/*",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": ["assets", "index.js", "index.d.ts"],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"fetch": "node fetch.mjs",
|
|
26
|
+
"prepack": "node fetch.mjs"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
31
|
+
}
|