Swift package · v0.1.0

KLOCRPipeline

Run OCR stages with explicit geometry and model boundaries.

A staged OCR pipeline for image preprocessing, Vision text recognition, reading-order reconstruction, and optional PaddleOCR Core ML inference.

Platforms
iOS 17+ · macOS 14+
Toolchain
Swift 6.0+
License
MIT
Dependencies
None

Functions

  • Explicit preprocessing and recognition stages
  • Vision and optional PaddleOCR paths
  • Reading-order reconstruction through KLReadingOrder
  • Testable model and runtime boundaries

Not included

It runs OCR stages and returns structured observations. Image acquisition, user-facing editing, model distribution, and persistence remain with the integrating application.

Install with SwiftPM

Package.swiftSwift
.package(url: "https://github.com/KoenLee1023/KLOCRPipeline.git", from: "0.1.0")

Usage

Integration exampleSwift
let result = try await pipeline.recognize(image)
let ordered = readingOrder.reconstruct(candidates: result.candidates)
KLOCRPipeline

Runs configured OCR stages and returns recognized candidates with source geometry.

KLOCRVision

Provides the Apple Vision recognition stage for supported image inputs.

PPOCRInferenceSession

Owns the boundary between validated tensors and a Core ML OCR model.

Demo apps

Vision Text Lab

Compare Vision output with post-processing and layout reconstruction.