Agent skill · Backend & API

vision-framework

Implement computer vision features including text recognition (OCR), face detection, barcode scanning, image segmentation, object tracking, and document scanning in iOS apps. Covers both the modern Swift-native Vision API (iOS 18+) and legacy VNRequest patterns, VisionKit DataScannerViewController for live camera scanning, and CoreMLRequest/VNCoreMLRequest for custom model inference. Use when adding OCR, barcode scanning, face detection, or custom Core ML model inference with Vision.

Derek Pearson935★ · +23/wk · 1 repos on radarProfile →
claude-codecodexcursorNOASSERTION
Install
npx skills add dpearson2699/swift-ios-skills --skill vision-framework --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 18 KB
Bundled scripts: none
Path: skills/vision-framework/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 963 · +28 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Detect text, faces, barcodes, objects, and body poses in images and video using on-device computer vision. Prefer the modern iOS 18+ request APIs and load the legacy reference only when the deployment target requires it.

How it works

  • Two API generations: modern Swift-native requests with perform(on:) and async/await, plus legacy VN* patterns for older targets.
  • Modern requests include specific types like RecognizeTextRequest, DetectFaceRectanglesRequest, DetectBarcodesRequest, GeneratePersonSegmentationRequest, TrackObjectRequest, GeneratePersonInstanceMaskRequest, CoreMLRequest, VNCoreMLRequest, etc.
  • Text Recognition (OCR): Modern RecognizeTextRequest with configurable recognitionLevel, languages, language correction, and customWords; legacy VNRecognizeTextRequest supported as fallback.
  • Face Detection: DetectFaceRectanglesRequest and DetectFaceLandmarksRequest with bounding boxes and landmarks; coordinate conversion to UIKit via NormalizedRect.
  • Barcode Detection: DetectBarcodesRequest with symbologies; iterate barcodes for payload, symbology, bounds.
  • Document Scanning (iOS 26+): RecognizeDocumentsRequest returning DocumentObservation with container, paragraphs, tables, lists, and embedded barcodes; VisionKit alternative via VNDocumentCameraViewController.
  • Image Segmentation: GeneratePersonSegmentationRequest (modern) producing a PixelBufferObservation; legacy VNGeneratePersonSegmentationRequest via handler; supports quality levels and instance segmentation via GeneratePersonInstanceMaskRequest (modern) and VNGeneratePersonInstanceMaskRequest (legacy).
  • Object Tracking: TrackObjectRequest (modern) maintains tracking context across frames; legacy VNTrackObjectRequest with iterative input.
  • Other Request Types: extensive list of additional Vision requests with purposes.
  • Core ML Integration: Vision can wrap Core ML models via CoreMLRequest or VNCoreMLRequest; modern path uses CoreMLModelContainer(model:), then CoreMLRequest(model:); legacy path uses VNCoreMLModel and VNCoreMLRequest with a completion handler.
  • VisionKit DataScannerViewController: live camera scanner for text and barcodes; usage includes configuring recognized data types and symbologies, and starting scanning after presentation.

When to use it

Use when adding OCR, barcode scanning, face detection, or custom Core ML model inference with Vision. Prefer modern iOS 18+ requests; fall back to legacy patterns only if deployment target requires it.

What it can touch

  • Modern: RecognizeTextRequest, DetectFaceRectanglesRequest, DetectBarcodesRequest, GeneratePersonSegmentationRequest, TrackObjectRequest, GeneratePersonInstanceMaskRequest, CoreMLRequest, VisionKit DataScannerViewController, etc.
  • Legacy: VNRecognizeTextRequest, VNDetectFaceRectanglesRequest, VNTrackObjectRequest, VNGeneratePersonSegmentationRequest, VNCoreMLRequest, VNDocumentCameraViewController usage via VisionKit, etc.

Caveats

  • Modern API requires iOS 18+ (and macOS 15+); legacy patterns exist for older targets.
  • Coordinate systems use NormalizedRect with bottom-left origin; conversion to UIKit coordinates is necessary for display.
  • Do not run Vision requests on the main thread; prefer background threads or async/await.
  • Avoid using .accurate for real-time feeds; use .fast for live video and .accurate for still/offline processing.
From the SKILL.md

# Vision Framework Detect text, faces, barcodes, objects, and body poses in images and video using on-device computer vision. Prefer the modern iOS 18+ request APIs and load the legacy reference only when the deployment target requires it. See [references/vision-requests.md](references/vision-requests.md) for complete code patterns and [references/visionkit-scanner.md](references/visionkit-scanner.md) for DataScannerViewController integration. ## Contents - [Two API Generations](#two-api-generations) - [Request Pattern (Modern API)](#request-pattern-modern-api) - [Text Recognition (OCR)](#text-recognition-ocr) - [Face Detection](#face-detection) - [Barcode Detection](#barcode-detection) - [Document Scanning (iOS 26+)](#document-scanning-ios-26) - [Image Segmentation](#image-segmentation) - [Object Tracking](#object-tracking) - [Other Request Types](#other-request-types) - [Core ML Integration](#core-ml-integration) - [VisionKit: DataScannerViewController](#visionkit-datascannerviewcontroller) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Two API Generations Vision has two distinct API layers. Prefer the modern API for n

What's inside
Steps it walks through
  1. Contents
  2. Two API Generations
  3. Request Pattern (Modern API)
  4. Legacy Pattern (Pre-iOS 18)
  5. Text Recognition (OCR)
  6. Modern: RecognizeTextRequest (iOS 18+)
  7. Legacy: VNRecognizeTextRequest
  8. Face Detection
  9. Coordinate System
  10. Barcode Detection
  11. Document Scanning (iOS 26+)
  12. Image Segmentation
  13. Modern: GeneratePersonSegmentationRequest (iOS 18+)
  14. Legacy: VNGeneratePersonSegmentationRequest
Ships with 3 files
  • evals/evals.json
  • references/vision-requests.md
  • references/visionkit-scanner.md
More from swift-ios-skills
All skills →
About this skill
What does the vision-framework skill do?

Implement computer vision features including text recognition (OCR), face detection, barcode scanning, image segmentation, object tracking, and document scanning in iOS apps. Covers both the modern Swift-native Vision API (iOS 18+) and legacy VNRequest patterns, VisionKit DataScannerViewController for live camera scanning, and CoreMLRequest/VNCoreMLRequest for custom model inference. Use when adding OCR, barcode scanning, face detection, or custom Core ML model inference with Vision.

How do I install it?

Run `npx skills add dpearson2699/swift-ios-skills --skill vision-framework --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dpearson2699/swift-ios-skills, a repository with 963 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going