macos-vision 0.3.0 ā 1.0.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/CHANGELOG.md +4 -0
- package/debug.js +37 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.1](https://github.com/woladi/macos-vision/compare/v0.3.1...v1.0.1) (2026-04-08)
|
|
4
|
+
|
|
5
|
+
## [0.3.1](https://github.com/woladi/macos-vision/compare/v0.3.0...v0.3.1) (2026-04-08)
|
|
6
|
+
|
|
3
7
|
## [0.3.0](https://github.com/woladi/macos-vision/compare/v0.2.0...v0.3.0) (2026-04-08)
|
|
4
8
|
|
|
5
9
|
### Features
|
package/debug.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ocr,
|
|
4
|
+
detectFaces,
|
|
5
|
+
detectBarcodes,
|
|
6
|
+
detectRectangles,
|
|
7
|
+
detectDocument,
|
|
8
|
+
classify,
|
|
9
|
+
inferLayout,
|
|
10
|
+
} from './dist/index.js';
|
|
11
|
+
|
|
12
|
+
const imagePath = process.argv[2] || './test/fixtures/sample.png';
|
|
13
|
+
console.log(`\nšø Analyzing: ${imagePath}\n`);
|
|
14
|
+
|
|
15
|
+
const [text, blocks, faces, barcodes, rects, doc, labels] = await Promise.all([
|
|
16
|
+
ocr(imagePath),
|
|
17
|
+
ocr(imagePath, { format: 'blocks' }),
|
|
18
|
+
detectFaces(imagePath),
|
|
19
|
+
detectBarcodes(imagePath),
|
|
20
|
+
detectRectangles(imagePath),
|
|
21
|
+
detectDocument(imagePath),
|
|
22
|
+
classify(imagePath),
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
const sep = (title) => console.log('\n' + 'ā'.repeat(60) + '\n' + title + '\n');
|
|
26
|
+
|
|
27
|
+
sep('š OCR text'); console.log(text);
|
|
28
|
+
sep('š OCR blocks'); console.log(JSON.stringify(blocks, null, 2));
|
|
29
|
+
sep('š¤ Faces'); console.log(JSON.stringify(faces, null, 2));
|
|
30
|
+
sep('š² Barcodes'); console.log(JSON.stringify(barcodes, null, 2));
|
|
31
|
+
sep('š¦ Rectangles'); console.log(JSON.stringify(rects, null, 2));
|
|
32
|
+
sep('š Document'); console.log(JSON.stringify(doc, null, 2));
|
|
33
|
+
sep('š·ļø Classification'); console.log(JSON.stringify(labels, null, 2));
|
|
34
|
+
|
|
35
|
+
const layout = inferLayout({ textBlocks: blocks, faces, barcodes, rectangles: rects, document: doc });
|
|
36
|
+
sep('šļø Layout (reading order)'); console.log(JSON.stringify(layout, null, 2));
|
|
37
|
+
console.log('\n' + 'ā'.repeat(60) + '\n');
|