✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.

Overview

ImageDetect

Awesome Version License Platform

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



To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  1. Xcode 9.0 (beta) or higher.
  2. 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

  1. Drag and Drop it into your project

  2. Import ImageDetect

  3. 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, [email protected]

License

ImageDetect is available under the MIT license. See the LICENSE file for more info.

You might also like...
A crop, compression, resize and trimming library for videos, based on AVKit.

VideoKit VideoKit is a high level layer on top of AVKit How it works // With this config, the video will get resized to 1920x1080p, the maximal length

A UIImageView extension to let the picture-cutting with faces showing better
A UIImageView extension to let the picture-cutting with faces showing better

UIImageView-BetterFace A UIImageView extension to let the picture-cutting with faces showing better Last update in v0.2_stable : add a UIImage+BetterF

A framework that lists all photos in the album that contain faces.

FaceCollectionViewKit A framework that lists all photos in the album that contain faces. Features It uses the detection features of CIDetectorTypeFace

Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator
Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator

Swifty-OCR-Translator Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator Usage Select Translator Fill in the AP

Inspired by HBO's Silicon Valley: SeeFood is an iOS app that uses CoreML to detect various dishes
Inspired by HBO's Silicon Valley: SeeFood is an iOS app that uses CoreML to detect various dishes

SeeFood For a step by step guide on how to build SeeFood: How to train your own model for CoreML. . Video Demo Follw me on Twitter Prerequisites: Xcod

Cordova plugin for detect screenshots and recordings

cordova-plugin-detect-screen-capture This plugin detects screen recording and screenshot events. The plugin will only work on devices with iOS = 7 Su

A demo of face recognition SwiftUI app on iOS. Based on Vision, OpenCV, Dlib and ResNet.

iOS-FaceRecognizer A demo of face recognition SwiftUI app on iOS, build for iPad. Based on Vision, OpenCV, Dlib and ResNet. Features Add face image an

SharkCardScan is a Credit/Debit Card scanner built using Apple's Vision Framework.
SharkCardScan is a Credit/Debit Card scanner built using Apple's Vision Framework.

iOS Credit/Debit card scanner, built using Apple's Vision Framework.

A simple macOS app to read code from images, written purely in Swift using Vision Framework.
A simple macOS app to read code from images, written purely in Swift using Vision Framework.

CodeReader A simple macOS app to read code from images, written purely in Swift using Vision Framework. Usage Drag an image Click the convert button R

Comments
  • Kellyroach/activity indicator

    Kellyroach/activity indicator

    This pull request adds an animating UIActivityIndicator to the Example app which animates during the couple seconds while cropFaces() works in background using GCD DispatchQueue's.

    • Add .DS_Store to .gitignore
    • Add SafeArea to Main.storyboard
    • Add UIActivityIndicator
    • cropFaces() works in background using GCD DispatchQueue's.
    • Remove Tests which aren't really testing anything.
    • Landscape Left + Landscape Right consistency.
    opened by kellyroach 0
Releases(1.1.4)
Owner
Arthur Sahakyan
Co Founder and CTO at Atomic S
Arthur Sahakyan
Utilizing Apple's Vision Framework to center faces in CGImage.

FaceCrop CGImage extension that utilizes Apple's Vision Framework to detect and center faces. Usage cgImage.faceCrop { [weak self] result in switc

Ancestry.com 40 Nov 24, 2022
Autocrop - A face-aware crop utility using OSX's Vision framework

autocrop A high-performance face-aware crop utility using OSX's Vision framework

Alex Dong 0 Jan 19, 2022
Vision Camera 📸 The Camera library that sees the vision.

Vision Camera ?? The Camera library that sees the vision. npm i react-native-vision-camera npx pod-install Documentation Guides API Ex

Marc Rousavy 3.5k Jan 5, 2023
Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)

WDImagePicker Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with WDImagePicker. Just set your custom crop area a

Wu Di 96 Dec 19, 2022
Simple image crop library for iOS

PhotoCropper This is a simple image crop library for iOS I made for fun on Chris

Aaron Lee 5 Jun 21, 2022
Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.

Welcome to Interactive Image View, a simple library that provides an easier way to interact with image view, like scroll, zoom and crop. In its core i

Egzon Pllana 23 Nov 7, 2022
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

Mohammad Zaid Pathan 219 Dec 17, 2022
An extension that gives UIImageView the ability to focus on faces within an image.

FaceAware Sometimes the aspect ratios of images we need to work with don't quite fit within the confines of our UIImageViews. In most cases we can use

Beau Nouvelle 3k Jan 3, 2023
Detecting Texts and Persons from Images

Detections Detecting Texts and Persons from Images Detections package will help you to get the texts from image and also recognize a person Image whih

Saeed Rahmatolahi 1 Nov 21, 2021
A view controller for iOS that allows users to crop portions of UIImage objects

TOCropViewController TOCropViewController is an open-source UIViewController subclass to crop out sections of UIImage objects, as well as perform basi

Tim Oliver 4.4k Jan 1, 2023