oil-oil/see-skill / see
see
Verified使用外部视觉服务或本地 OCR 分析本地图片、截图、视频及明确提供的媒体 URL,输出 Markdown。用户明确要求 see,或当前主模型缺少完成媒体分析所需的视觉能力时使用。不拦截普通文本、任意 URL 或已有原生视觉可以直接完成的任务;不用于生图、编辑图片或自动操作屏幕。使用外部服务前说明发送的媒体与服务范围,无法识别时如实说明限制。
scripts/ocr_macos.js
View on GitHubObjC.import("CoreGraphics");
ObjC.import("Foundation");
ObjC.import("ImageIO");
ObjC.import("Vision");
function unwrap(value) {
return ObjC.unwrap(value);
}
function run(argv) {
if (argv.length !== 1) {
throw new Error("Usage: ocr_macos.js <image-path>");
}
const path = argv[0];
const url = $.NSURL.fileURLWithPath(path);
const source = $.CGImageSourceCreateWithURL(url, null);
if (!source) {
throw new Error("Cannot decode image: " + path);
}
const image = $.CGImageSourceCreateImageAtIndex(source, 0, null);
if (!image) {
throw new Error("Cannot decode image: " + path);
}
const request = $.VNRecognizeTextRequest.alloc.init;
request.recognitionLevel = 0;
request.usesLanguageCorrection = true;
if (request.respondsToSelector("supportedRecognitionLanguagesAndReturnError:")) {
const languageError = Ref();
const supported = request.supportedRecognitionLanguagesAndReturnError(languageError);
const preferred = ["zh-Hans", "zh-Hant", "en-US"];
const selected = [];
for (let index = 0; index < preferred.length; index += 1) {
if (supported.containsObject($(preferred[index]))) {
selected.push(preferred[index]);
}
}
if (selected.length > 0) {
request.recognitionLanguages = $(selected);
}
}
const handler = $.VNImageRequestHandler.alloc.initWithURLOptions(
url,
$.NSDictionary.dictionary
);
const error = Ref();
const requests = $.NSArray.arrayWithObject(request);
if (!handler.performRequestsError(requests, error)) {
const detail = error[0] ? unwrap(error[0].localizedDescription) : "unknown error";
throw new Error("Vision OCR failed: " + detail);
}
const items = [];
const results = request.results;
for (let index = 0; index < Number(results.count); index += 1) {
const observation = results.objectAtIndex(index);
const candidates = observation.topCandidates(1);
if (Number(candidates.count) === 0) {
continue;
}
const candidate = candidates.objectAtIndex(0);
const box = observation.boundingBox;
items.push({
text: unwrap(candidate.string),
confidence: Number(candidate.confidence),
box: {
x: Number(box.origin.x),
y: Number(1 - box.origin.y - box.size.height),
width: Number(box.size.width),
height: Number(box.size.height),
},
});
}
return JSON.stringify({
backend: "macos-vision",
width: Number($.CGImageGetWidth(image)),
height: Number($.CGImageGetHeight(image)),
items,
});
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |