@qvac/ocr-ggml 0.25.0 → 0.25.1

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  # @qvac/ocr-ggml
2
2
 
3
3
  GGML-backed OCR addon for [QVAC](https://github.com/tetherto/qvac).
4
+
5
+ EasyOCR model loading rejects detector output shapes, recognizer class counts, malformed prediction bias vectors, and convolution bias sizes that do not match the expected tensors.
4
6
  Provides two inference pipelines on **`ggml` / `.gguf`** — no Python, no
5
7
  PyTorch, and no ONNX Runtime at runtime:
6
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/ocr-ggml",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "GGML-backed OCR addon for qvac (EasyOCR and DocTR pipelines on GGUF weights)",
5
5
  "addon": true,
6
6
  "engines": {
@@ -33,8 +33,8 @@
33
33
  "test": "npm run lint && npm run test:types && npm run test:unit && npm run test:integration",
34
34
  "test:types": "npm run typecheck && npm run check:generated",
35
35
  "test:dts": "npm run test:types",
36
- "test:cpp:build": "bare-make generate -D BUILD_TESTING=ON && bare-make build --target addon-test",
37
- "test:cpp:run": "cd build/addon/tests/ && ./addon-test --gtest_output=xml:cpp-test-results.xml",
36
+ "test:cpp:build": "bare-make generate -D BUILD_TESTING=ON && bare-make build --target addon-test ocr-prediction-bias-gguf-test",
37
+ "test:cpp:run": "cd build/addon/tests/ && ./addon-test --gtest_output=xml:cpp-test-results.xml && ./ocr-prediction-bias-gguf-test --gtest_output=xml:prediction-bias-gguf-test-results.xml",
38
38
  "test:cpp": "npm run test:cpp:build && npm run test:cpp:run",
39
39
  "setup:venv": "bash scripts/setup-venv.sh",
40
40
  "convert-model": "bash scripts/convert-model.sh",
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.25"
10
+ "version": "0.25.1"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.25"
10
+ "version": "0.25.1"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.25"
10
+ "version": "0.25.1"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.25"
10
+ "version": "0.25.1"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.25"
10
+ "version": "0.25.1"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { OcrGgml, QvacErrorAddonOcrGgml, ERR_CODES, binding } = require('../..')
4
4
  const test = require('brittle')
5
- const { isMobile, ensureModelPath, getImagePath } = require('./utils')
5
+ const { isMobile, ensureModelPath, getImagePath, OCR_TEST_THREADS } = require('./utils')
6
6
 
7
7
  const MOBILE_TIMEOUT = 600 * 1000
8
8
  const DESKTOP_TIMEOUT = 120 * 1000
@@ -26,7 +26,8 @@ async function loadOcr() {
26
26
  params: {
27
27
  pathDetector: detectorPath,
28
28
  pathRecognizer: recognizerPath,
29
- langList: ['en']
29
+ langList: ['en'],
30
+ nThreads: OCR_TEST_THREADS
30
31
  }
31
32
  })
32
33
 
@@ -164,7 +165,8 @@ test(
164
165
  pathRecognizer: recognizerPath,
165
166
  langList: ['en'],
166
167
  defaultRotationAngles: [90, 180, 270],
167
- contrastRetry: true
168
+ contrastRetry: true,
169
+ nThreads: OCR_TEST_THREADS
168
170
  }
169
171
  })
170
172
 
@@ -352,6 +352,7 @@ try {
352
352
  const platform = os.platform()
353
353
  const isMobile = platform === 'ios' || platform === 'android'
354
354
  const isWindows = platform === 'win32'
355
+ const OCR_TEST_THREADS = 4
355
356
 
356
357
  function _envInt(key, fallback) {
357
358
  let raw = ''
@@ -488,7 +489,7 @@ function getBackendDevice() {
488
489
  function createOcrGgml(params = {}, opts) {
489
490
  const { OcrGgml } = require('../..')
490
491
  const instance = new OcrGgml({
491
- params: { backendDevice: getBackendDevice(), ...params },
492
+ params: { backendDevice: getBackendDevice(), nThreads: OCR_TEST_THREADS, ...params },
492
493
  opts
493
494
  })
494
495
  // After load() resolves the backend, record the actual GPU/backend name on
@@ -1063,7 +1064,7 @@ async function runDoctrOCR(t, params, imagePath) {
1063
1064
  params: {
1064
1065
  langList: ['en'],
1065
1066
  pipelineType: 'doctr',
1066
- nThreads: 4,
1067
+ nThreads: OCR_TEST_THREADS,
1067
1068
  backendDevice: getBackendDevice(),
1068
1069
  ...params
1069
1070
  },
@@ -1351,7 +1352,7 @@ async function runDoctrWarmProfile(t, cfg) {
1351
1352
  params: {
1352
1353
  langList: ['en'],
1353
1354
  pipelineType: 'doctr',
1354
- nThreads: 4,
1355
+ nThreads: OCR_TEST_THREADS,
1355
1356
  backendDevice: 'vulkan',
1356
1357
  ...params
1357
1358
  },
@@ -1439,6 +1440,7 @@ module.exports = {
1439
1440
  runDoctrWarmProfile,
1440
1441
  isWindows,
1441
1442
  platform,
1443
+ OCR_TEST_THREADS,
1442
1444
  PERF_RUNS,
1443
1445
  PREBUILDS_DIR,
1444
1446
  findVulkanBackendLib,