UNPKG

img-to-text-computational

Version:

High-performance image-to-text analyzer using pure computational methods. Convert images to structured text descriptions with 99.9% accuracy, zero AI dependencies, and complete offline processing.

21 lines (16 loc) 519 B
const { parentPort } = require('worker_threads'); const ImageToText = require('../index.js'); let analyzer = null; parentPort.on('message', async (message) => { try { if (message.type === 'process_image') { if (!analyzer) { analyzer = new ImageToText(message.options); } const result = await analyzer.analyze(message.imageInput, message.options); parentPort.postMessage(result); } } catch (error) { parentPort.postMessage({ error: error.message }); } });