ImageDetect
✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.
Install / Use
/learn @Feghal/ImageDetectREADME
ImageDetect
ImageDetect is a library developed on Swift. With ImageDetect you can easily detect and crop faces, texts or barcodes in your image with iOS 11 Vision api. It will automatically create new images containing each object found within a given image.
Example
<br> <a href="url"><img src="https://github.com/Feghal/ImageDetect/blob/master/Screenshots/1.PNG" align="top" height="550" width="275" ></a> <a href="url"><img src="https://github.com/Feghal/ImageDetect/blob/master/Screenshots/2.PNG" align="top" height="550" width="275" ></a> <br>To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
- Xcode 9.0 (beta) or higher.
- iOS 11.0 (beta) or higher.
Installation
CocoaPods
ImageDetect is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ImageDetect'
Then, run the following command:
pod install
Manually
-
Drag and Drop it into your project
-
Import
ImageDetect -
You are ready to go!
Usage
Crop your (UIImage or CGImage)
// `type` in this method can be face, barcode or text
image.detector.crop(type: .face) { [weak self] result in
switch result {
case .success(let croppedImages):
// When the `Vision` successfully find type of object you set and successfuly crops it.
print("Found")
case .notFound:
// When the image doesn't contain any type of object you did set, `result` will be `.notFound`.
print("Not Found")
case .failure(let error):
// When the any error occured, `result` will be `failure`.
print(error.localizedDescription)
}
}
Author
Arthur Sahakyan, feghaldev@gmail.com
License
ImageDetect is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
