MCFastVision 是一个基于 iOS Vision 框架的轻量级通用视觉识别工具库,封装了文字识别(OCR)、条形码/二维码识别、人脸检测、人脸关键点检测、矩形检测、动物识别(猫与狗)、人像分割(人物蒙版生成)等能力,并提供统一的配置入口与识别结果绘制能力(支持框选、关键点、蒙版叠加等可视化),支持快速集成到业务项目中,用于扫描、识别、检测、背景虚化、抠图与可视化标注等场景。
-
iOS Version:
- iOS 15.0+(完整支持所有功能,包括人像分割)
- iOS 13.0+(支持 OCR、条码、人脸、矩形、动物识别等核心功能)
-
Device Compatibility:
- 支持所有 iPhone/iPad(A12 Bionic 及以上芯片性能最佳,尤其是实时视频流 + 人像分割)
-
Dependencies: 无任何第三方库依赖
纯 Apple 原生框架,无需额外安装包。
通过 CocoaPods 安装该库:
# 在 Podfile 中添加
pod 'MCFastVision'然后在项目目录运行:
pod installMCFastVision is a lightweight, general-purpose visual recognition toolkit built on the iOS Vision framework. It encapsulates capabilities such as text recognition (OCR), barcode/QR code recognition, face detection, facial keypoint detection, rectangle detection, animal recognition (cats and dogs), and portrait segmentation (person mask generation). It provides a unified configuration interface and the ability to visualize recognition results (supporting visualizations like box selection, keypoint overlay, and mask overlay). It supports rapid integration into business projects for scenarios such as scanning, recognition, detection, background blurring, image clipping, and visual annotation.
- iOS Version:
- iOS 15.0+ (full support for all features, including portrait segmentation)
- iOS 13.0+ (support for core features such as OCR, barcode, face, rectangle, animal recognition, etc.)
- Device Compatibility: Supports all iPhone/iPad devices (A12 Bionic and above perform best, especially for real-time video streaming + portrait segmentation)
- Dependencies: No third-party library dependencies. Pure Apple native framework, no additional installation packages required.
Add to your Podfile:
pod 'MCFastVision'Then run:
pod install以下是项目未来的优化方向(欢迎 PR 或 Issue 讨论):
-
实时视频流支持
添加针对 CVPixelBuffer 的检测变体(如detect(in pixelBuffer: CVPixelBuffer, completion: ...)),结合VNSequenceRequestHandler实现相机预览或视频流的连续识别。目标:支持实时人脸/动物/分割等功能,适用于 AR、直播滤镜、监控等场景。 -
自定义 Core ML 支持
引入VNCoreMLRequest入口,允许用户传入自定义 .mlmodel 文件(e.g. YOLO、MobileNet、自定义物体检测模型)。这将大幅提升扩展性,支持更多类别(如汽车、水杯、食物、植物等)的物体识别。
其他潜在方向:
- 支持人体姿态 / 手势检测(VNDetectHumanBodyPoseRequest / VNDetectHumanHandPoseRequest)
- 视频处理支持(批量帧处理或导出带标注的视频)
- Swift Package Manager (SPM) 集成
欢迎贡献代码、测试用例或想法!
本项目基于 MIT License 开源协议。