SwiftOCR schooled Tesseract on gift cards, then quit
A neural-network OCR engine for iOS and macOS that specialized in short alphanumeric codes, until its own author concluded Apple Vision had made it obsolete.

What it does SwiftOCR reads short, one-line alphanumeric strings—think gift-card codes or serial numbers—from images on iOS and macOS. It preprocesses the image, extracts characters via connected-component labeling, and runs them through a neural network. The project is now deprecated; the author explicitly recommends Apple’s Vision framework instead.
The interesting bit The README admits Tesseract wins on normal prose, then claims SwiftOCR dominates the narrow niche it actually targets. In the author’s own tests on over 50 difficult images, it reportedly hit 97.7% accuracy in 0.08 seconds versus Tesseract’s 45.2% in 0.63 seconds, while using less CPU and memory. That level of specificity is unusual.
Key highlights
- Optimized specifically for short alphanumeric codes, not long-form text
- Uses connected-component labeling to segment characters before neural-network recognition
- Includes a macOS training app for adding new fonts
- Claims 97.7% accuracy on the author’s 50-image test set, with lower resource use than Tesseract
- Supports iOS and macOS; depends on Swift-AI, GPUImage, and a Union-Find implementation
Caveats
- Explicitly deprecated and unmaintained; the author directs all users to Apple Vision
- The GPUImage 2 port listed in TODO was never completed
- Benchmarks come from the author’s own tests on just over 50 difficult images
Verdict Worth a look only if you are maintaining legacy code or studying how to build a narrow-purpose OCR pipeline in Swift. Everyone else should follow the author’s advice and use Apple Vision.
Frequently asked
- What is NMAC427/SwiftOCR?
- A neural-network OCR engine for iOS and macOS that specialized in short alphanumeric codes, until its own author concluded Apple Vision had made it obsolete.
- Is SwiftOCR open source?
- Yes — NMAC427/SwiftOCR is open source, released under the Apache-2.0 license.
- What language is SwiftOCR written in?
- NMAC427/SwiftOCR is primarily written in Swift.
- How popular is SwiftOCR?
- NMAC427/SwiftOCR has 4.6k stars on GitHub.
- Where can I find SwiftOCR?
- NMAC427/SwiftOCR is on GitHub at https://github.com/NMAC427/SwiftOCR.