Vision Framework Diagnostics
Systematic troubleshooting for Vision and VisionKit, from photos where nothing is detected to overlays in the wrong place. It also covers slow requests, live scanners, and document scans.
Symptoms This Diagnoses
Use when you're experiencing:
- Nothing detected in a photo that clearly contains the subject
- Hand, body, or face landmarks that are missing or have low confidence
- An interface that freezes while a request runs, or a camera feed that drops frames
- Overlays drawn in the wrong place
- Person segmentation that misses people in a crowd
- VisionKit subject lifting that shows no interface
- Text that isn't detected, is misread, or takes too long
- Barcodes that aren't detected, or that return the wrong payload
DataScannerViewControllershowing a blank screen, or finding nothing- Document edges that aren't found, or perspective correction that comes out wrong
- A resource error the first time tap-to-segment runs on the 27 releases
VNtypes that don't exist when you build for watchOS
Example Prompts
- "Vision finds no hands in my camera frames. What should I check?"
- "My face detection boxes are drawn in the wrong place on screen."
- "The UI freezes while my Vision request runs."
- "Faces are detected in landscape photos but not portrait ones."
- "Why does text recognition return the wrong characters?"
- "DataScannerViewController shows a blank screen."
- "Vision fails the first time it runs on iOS 27. Is a model still downloading?"
Diagnostic Workflow
Your assistant checks the likely causes in order before changing code.
- Orientation – Handlers assume an upright image, so a rotated photo looks sideways. Check this first when a photo that clearly contains the subject returns nothing.
- Detection – Run diagnostic code to separate a failed request from a request that found nothing.
- Confidence – Print each landmark's score, then look at lighting, occlusion, and subjects near the edge of the frame.
- Threading – Confirm Vision isn't running on the main thread.
- Symptom pattern – Follow the decision tree to one of the skill's patterns for pose, faces, performance, coordinates, crowded scenes, VisionKit, text, barcodes, scanners, or documents.
The skill estimates a fix time for each symptom. It also compares the original VN API with the modern Swift API, which returns typed results, runs off the main actor, and converts coordinates for you.
Documentation Scope
This page documents the vision-diag skill (in the axiom-vision suite), which your assistant loads when a Vision feature misbehaves. The skill includes the diagnostic code, a fix for each pattern, and a production crisis scenario.
- For choosing the right API in the first place, see vision-framework
- For API details and the watchOS subset, see vision-ref
Related
- camera-capture-diag – When the frames themselves are wrong, frozen, or rotated
- swift-concurrency – Moving analysis off the main actor safely
- swiftui-performance – When the interface is slow but Vision isn't the cause
Resources
WWDC: 2019-234, 2020-10653, 2021-10041, 2022-10024, 2022-10025, 2023-10176, 2025-272, 2026-237
Docs: /vision, /vision/vnrecognizetextrequest, /visionkit