coreml-vision

coreml-vision is a skill for Claude Code, Codex from wangjianqi/AppStore. It costs 42 tokens per session (2,626 once invoked), scanned A, original, MIT.

A guide for using Core ML and Vision, Apple frameworks for running machine-learning models and analysing images on Apple devices. It covers model loading, image recognition, object detection, face detection, model conversion, and inference performance.

In plain words
What is it for?
Use it when adding local image analysis such as YOLO object detection, CLIP image processing, or face detection to an iOS app.
Why use it?
It gives a defined way to store, version, load, and run models without loading them synchronously during app startup.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding local image analysis such as YOLO object detection, CLIP image processing, or face detection to an iOS app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wangjianqi/appstore/03-coreml-vision
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wangjianqi/AppStore --skill 03-coreml-vision
Clone the repo
git clone --depth 1 https://github.com/wangjianqi/AppStore

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coreml-vision

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangjianqi/appstore/03-coreml-vision/github.svg)](https://agentmods.dev/skills/wangjianqi/appstore/03-coreml-vision)
Your own site
<a href="https://agentmods.dev/skills/wangjianqi/appstore/03-coreml-vision"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/03-coreml-vision/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for coreml-vision

Your own site · 80×15
<a href="https://agentmods.dev/skills/wangjianqi/appstore/03-coreml-vision"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/03-coreml-vision.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,626 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.02626
Opus 5 $0.00021 $0.01313
Sonnet 5 $0.00008 $0.00525
Haiku 4.5 $0.00004 $0.00263

Measured 8d ago against content hash 0d84359c3ca6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

coreml-vision scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ios-claude-skills/03-coreml-vision/SKILL.md · 314 lines

How it starts

The opening of the file, as written. The whole thing — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CoreML / Vision 本地推理

模型管理

目录结构

Resources/
└── Models/
    ├── YOLOv8n_v2.mlpackage       # 版本号在文件名中
    ├── MobileNetV3.mlmodel
    └── CLIP_Quantized.mlpackage   # 量化版标注

加载规范

  • 所有 .mlmodel / .mlpackage 文件放在 Resources/Models/ 目录
  • 模型加载使用懒加载,禁止在 App 启动时同步加载
  • 模型版本通过文件名区分(如 YOLOv8n_v2.mlpackage),禁止覆盖旧版本
  • 启用 Metal 加速:
final class ModelManager {
    static let shared = ModelManager()

    private var yoloModel: VNCoreMLModel?

    func loadYOLO() throws -> VNCoreMLModel {
        if let model = yoloModel { return model }
        let config = MLModelConfiguration()
        config.computeUnits = .all  // CPU + GPU + Neural Engine
        let model = try YOLOv8n_v2(configuration: config)
        yoloModel = try VNCoreMLModel(for: model.model)
        yoloModel?.inputImageFeatureName = "image"
        yoloModel?.outputFeatureName = "var_894"
        return yoloModel!
    }

    func unloadAll() {
        yoloModel = nil
    }
}

Vision Pipeline — 静态图像

完整推理流程

final class ImageDetector {
    private let model: VNCoreMLModel

    init(model: VNCoreMLModel) {
        self.model = model
    }

    func detect(in image: UIImage, confidenceThreshold: Float = 0.5) throws -> [Detection] {
        guard let cgImage = image.cgImage else {
            throw VisionError.invalidImage
        }

        let request = VNCoreMLRequest(model: model) { request, error in
            // 结果在下方处理
        }
        request.imageCropAndScaleOption = .scaleFill

        let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
        try handler.perform([request])

        guard let observations = request.results as? [VNRecognizedObjectObservation] else {
            return []
        }

        return observations.compactMap { observation in
            guard let label = observation.labels.first,
                  label.confidence >= confidenceThreshold else { return nil }
            return Detection(
                label: label.identifier,
                confidence: label.confidence,
                boundingBox: observation.boundingBox
            )
        }
    }
}

struct Detection {
    let label: String
    let confidence: Float
    let boundingBox: CGRect
}

Read the full file on GitHub · 314 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 314 lines · 42 tokens per session scan A 0d84359c3ca6

Subscribe to this mod's changes

coreml-vision is a skill published in the GitHub repository wangjianqi/AppStore (11 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 2,626 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

maui-essentials-ai

Adopt Microsoft.Maui.Essentials.AI for local/on-device MAUI AI. USE FOR: Apple Intelligence chat, IChatClient, iOS/macOS/Mac Catalyst 26+ checks, fallback UI, NLEmbeddingGenerator, local tool invocation, privacy/offline UX. DO NOT USE FOR: source-generated tools, cloud-only AI, UI debugging.

dotnet/maui-labs · 86 tokens

deploy-edge-ai-model

Deploy machine learning models to edge devices using Google AI Edge Gallery, TensorFlow Lite, ONNX Runtime, and MediaPipe. Covers model quantization (INT8/INT4), on-device inference with Gemma 4 models, Android/iOS deployment via AI Edge Gallery, hardware delegate selection (GPU/NPU/DSP), and performance benchmarking…

pjt222/agent-almanac · 108 tokens

vision-framework

On-device image analysis for an iOS fintech app with Apple's Vision + VisionKit. Covers the modern Swift Vision API (iOS 18+: RecognizeTextRequest OCR, DetectFaceRectanglesRequest, DetectBarcodesRequest, DetectDocumentSegmentationRequest, GenerateForegroundInstanceMaskRequest, TrackObjectRequest, CoreMLRequest, all…

TalissonVitorino/kmp-ios-skills · 237 tokens

apple-on-device-ai

On-device generative AI on Apple platforms (iOS 26+) — the Foundation Models framework (SystemLanguageModel.availability, LanguageModelSession, respond(to:)/streamResponse, @Generable + @Guide guided generation, the Tool protocol for tool-calling, instructions, GenerationOptions, and Guardrails), plus choosing among…

TalissonVitorino/kmp-ios-skills · 188 tokens

coreml

On-device ML inference with Core ML on iOS/iPadOS 26. Covers model formats (.mlmodel/.mlpackage/.mlmodelc), the Xcode auto-generated model class + Input/Output, MLModel loading (async load / compileModel), MLFeatureProvider / MLFeatureValue, MLModelConfiguration.computeUnits…

TalissonVitorino/kmp-ios-skills · 255 tokens

ipaship-audit

Use when auditing iOS/Android app submissions for compliance with Apple App Store Review Guidelines or Google Play Developer Policies. Scan .ipa, .apk, or .zip files against official store policies, generate structured compliance reports, and identify violations with remediation steps.

atharvnaik1/ipaship-audit · 57 tokens