@arcships/light-ocr 0.3.4 → 0.4.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/README.md +3 -7
- package/package.json +12 -28
- package/src/cli.cjs +22 -0
- package/src/index.cjs +27 -0
- package/src/index.d.ts +21 -0
- package/{js → src}/index.mjs +1 -0
- package/bin/light-ocr.cjs +0 -594
- package/js/exif.cjs +0 -241
- package/js/index.cjs +0 -226
- package/js/index.d.ts +0 -284
- package/js/load-native.cjs +0 -499
package/README.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
# @arcships/light-ocr
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The default PP-OCRv6 Small entry for `light-ocr`. It exact-pins one compatible model-free runtime and one Small model package, and remains the only owner of the `light-ocr` command.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install @arcships/light-ocr
|
|
7
|
+
light-ocr info --version
|
|
7
8
|
```
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
runtime model download or postinstall compilation is used.
|
|
11
|
-
|
|
12
|
-
Documentation: https://github.com/arcships/light-ocr
|
|
13
|
-
|
|
14
|
-
License: Apache-2.0
|
|
10
|
+
`0.4.0` is the N2 topology cutover: the facade contains only Small model configuration and delegates the API, native loading, EXIF handling, and CLI implementation to the shared runtime. Tiny and Medium use separate packages and commands, so installing this package still installs only Small.
|
package/package.json
CHANGED
|
@@ -1,52 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bin": {
|
|
3
|
-
"light-ocr": "./
|
|
3
|
+
"light-ocr": "./src/cli.cjs"
|
|
4
4
|
},
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/arcships/light-ocr/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@arcships/light-ocr-model-ppocrv6-small": "0.3.4"
|
|
9
|
+
"@arcships/light-ocr-model-ppocrv6-small": "0.3.4",
|
|
10
|
+
"@arcships/light-ocr-runtime": "0.1.0"
|
|
10
11
|
},
|
|
11
|
-
"description": "Offline PP-OCRv6 OCR for Node.js
|
|
12
|
+
"description": "Offline PP-OCRv6 Small OCR for Node.js — the stable default tier",
|
|
12
13
|
"engines": {
|
|
13
14
|
"node": "^22.0.0 || ^24.0.0"
|
|
14
15
|
},
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
|
-
"import": "./
|
|
18
|
-
"require": "./
|
|
19
|
-
"types": "./
|
|
18
|
+
"import": "./src/index.mjs",
|
|
19
|
+
"require": "./src/index.cjs",
|
|
20
|
+
"types": "./src/index.d.ts"
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
"files": [
|
|
23
|
-
"
|
|
24
|
-
"bin/",
|
|
24
|
+
"src/",
|
|
25
25
|
"README.md",
|
|
26
26
|
"LICENSE",
|
|
27
27
|
"NOTICE"
|
|
28
28
|
],
|
|
29
29
|
"homepage": "https://github.com/arcships/light-ocr#readme",
|
|
30
|
-
"keywords": [
|
|
31
|
-
"ocr",
|
|
32
|
-
"offline-ocr",
|
|
33
|
-
"pp-ocrv6",
|
|
34
|
-
"paddleocr",
|
|
35
|
-
"node-api",
|
|
36
|
-
"napi"
|
|
37
|
-
],
|
|
38
30
|
"license": "Apache-2.0",
|
|
39
|
-
"main": "./
|
|
40
|
-
"module": "./
|
|
31
|
+
"main": "./src/index.cjs",
|
|
32
|
+
"module": "./src/index.mjs",
|
|
41
33
|
"name": "@arcships/light-ocr",
|
|
42
|
-
"optionalDependencies": {
|
|
43
|
-
"@arcships/light-ocr-darwin-arm64": "0.3.4",
|
|
44
|
-
"@arcships/light-ocr-darwin-x64": "0.3.4",
|
|
45
|
-
"@arcships/light-ocr-linux-arm64-gnu": "0.3.4",
|
|
46
|
-
"@arcships/light-ocr-linux-x64-gnu": "0.3.4",
|
|
47
|
-
"@arcships/light-ocr-win32-arm64": "0.3.4",
|
|
48
|
-
"@arcships/light-ocr-win32-x64": "0.3.4"
|
|
49
|
-
},
|
|
50
34
|
"publishConfig": {
|
|
51
35
|
"access": "public",
|
|
52
36
|
"provenance": true
|
|
@@ -56,6 +40,6 @@
|
|
|
56
40
|
"url": "git+https://github.com/arcships/light-ocr.git"
|
|
57
41
|
},
|
|
58
42
|
"type": "commonjs",
|
|
59
|
-
"types": "./
|
|
60
|
-
"version": "0.
|
|
43
|
+
"types": "./src/index.d.ts",
|
|
44
|
+
"version": "0.4.0"
|
|
61
45
|
}
|
package/src/cli.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const facade = require('./index.cjs');
|
|
5
|
+
const { createCli } = require('@arcships/light-ocr-runtime/cli');
|
|
6
|
+
const { coreVersion } = require('@arcships/light-ocr-runtime/metadata');
|
|
7
|
+
const packageMetadata = require('../package.json');
|
|
8
|
+
|
|
9
|
+
const cli = createCli({
|
|
10
|
+
...facade,
|
|
11
|
+
commandName: 'light-ocr',
|
|
12
|
+
packageVersion: packageMetadata.version,
|
|
13
|
+
coreVersion,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
if (require.main === module) {
|
|
17
|
+
cli.main(process.argv.slice(2)).then((code) => {
|
|
18
|
+
if (code !== cli.EXIT.success) process.exitCode = code;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = cli;
|
package/src/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { createModelFacade } = require('@arcships/light-ocr-runtime/facade');
|
|
4
|
+
|
|
5
|
+
module.exports = createModelFacade({
|
|
6
|
+
model: 'ppocrv6-small',
|
|
7
|
+
modelPackage: '@arcships/light-ocr-model-ppocrv6-small',
|
|
8
|
+
compatibleBundleIds: [
|
|
9
|
+
'ppocrv6-small-onnx-20260714.2',
|
|
10
|
+
'ppocrv6-small-apple-20260715.1',
|
|
11
|
+
'ppocrv6-small-webgpu-20260719.1',
|
|
12
|
+
'ppocrv6-small-native-20260719.1',
|
|
13
|
+
],
|
|
14
|
+
appleBundleIds: [
|
|
15
|
+
'ppocrv6-small-apple-20260715.1',
|
|
16
|
+
'ppocrv6-small-native-20260719.1',
|
|
17
|
+
],
|
|
18
|
+
profile: {
|
|
19
|
+
tier: 'small',
|
|
20
|
+
model: 'ppocrv6-small',
|
|
21
|
+
bundleId: 'ppocrv6-small-native-20260719.1',
|
|
22
|
+
languages: 50,
|
|
23
|
+
excludedLanguages: [],
|
|
24
|
+
dictionaryEntries: 18709,
|
|
25
|
+
maturity: 'stable',
|
|
26
|
+
},
|
|
27
|
+
});
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from '@arcships/light-ocr-runtime';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
CreateEngineOptions as RuntimeCreateEngineOptions,
|
|
5
|
+
ModelProfile,
|
|
6
|
+
OcrEngine,
|
|
7
|
+
} from '@arcships/light-ocr-runtime';
|
|
8
|
+
|
|
9
|
+
export type BuiltInModel = 'ppocrv6-small';
|
|
10
|
+
|
|
11
|
+
export type CreateEngineOptions = Omit<RuntimeCreateEngineOptions, 'bundlePath'> & {
|
|
12
|
+
readonly model?: BuiltInModel;
|
|
13
|
+
readonly bundlePath?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function createEngine(options?: CreateEngineOptions): Promise<OcrEngine>;
|
|
17
|
+
export const modelProfile: ModelProfile & {
|
|
18
|
+
readonly tier: 'small';
|
|
19
|
+
readonly model: BuiltInModel;
|
|
20
|
+
readonly maturity: 'stable';
|
|
21
|
+
};
|
package/{js → src}/index.mjs
RENAMED