This commit is contained in:
2026-09-11 14:20:57 -04:00
parent 275a44975f
commit 78cb03e6cb
22 changed files with 248 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
import { acquireQvac, releaseQvac, loadAuxiliaryModel, qvacSdk, withQvacMaster } from './qvac-master.js';
export class QvacPerception {
constructor({ model = process.env.JARVIS_OCR_MODEL || 'OCR_LATIN' } = {}) { this.model = model; this.modelId = null; }
async ocr(image) {
await acquireQvac();
try {
this.modelId ||= await loadAuxiliaryModel(this.model, {});
const sdk = await qvacSdk();
const result = await withQvacMaster(() => sdk.ocr({ modelId: this.modelId, image, stream: false }));
return result.blocks;
} finally { releaseQvac(); }
}
}