Skip to content

xinetzone/SpecWeave / .agents/skills/local-ocr-npu

local-ocr-npu

Flagged

Local NPU OCR (本地NPU文字识别). Use this skill when the user wants to extract, recognize, or read text from one or more local image files. Trigger on: - Chinese: 识别/提取/读取/扫描 + 图片/截图/照片/文字/内容, OCR, 文字识别, 文字提取 - English: OCR, extract text, recognize text, read text from image, scan document Supported input: - Single image file: jpg / jpeg / png / bmp / tiff - Directory path containing multiple images Runs entirely on-device using Intel NPU (PP-OCRv5-server model, fp16). No cloud API is called. Requires Intel Core Ultra (AIPC) platform. Do NOT skip this skill for any text-extraction or document-digitization request that involves local image files — always prefer this over Python/cloud OCR.

local-ocr-npu Skill Guide

Usage

Run OCR on a single image

scripts\run.ps1 "<image_path>"

Run OCR on all images in a directory

scripts\run.ps1 "<image_directory>"

Override device (default: npu)

scripts\run.ps1 "<image_path>" -Device cpu

Examples

IntentCommand
Extract text from a screenshotscripts\run.ps1 "C:\Users\user\Desktop\screenshot.png"
OCR all images in a folderscripts\run.ps1 "C:\invoice_images"
Force CPU fallbackscripts\run.ps1 "image.jpg" -Device cpu

Output format

Recognized text is printed line-by-line in reading order, with confidence score:

[0.997] 增值税专用发票
[0.985] 发票代码:1100183130
[0.991] 开票日期:2024年03月15日
...
OCR completed: 1 image(s) | NPU | avg 0.32 s/image

Important notes

  • scripts\run.ps1 is the only supported interface. Do NOT call other scripts directly.
  • The first NPU call compiles the model to NPU ISA (takes ~27 s). Subsequent calls use the on-disk cache and start in ~0.3 s.
  • If run.ps1 returns This skill requires an Intel AIPC platform with exit code 1, the hardware does not support NPU. Do NOT retry — tell the user to use -Device cpu.

Performance for reference (Intel PTL 12XE, PP-OCRv5-server)

Device1st init2nd initAvg inference
NPU~27 s~0.32 s0.32 s/img
CPU~0.40 s~0.35 s1.50 s/img
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall