Crop faces, inside of your image, with iOS 11 Vision api.

Overview

FaceCropper

Version License

Requirements

  • Xcode 9.0 (beta) or higher.
  • iOS 11.0 (beta) or higher.
    • (It is possible to import this library under the iOS 11. But it won't be working.)

Usage

  • Crop faces from your image (UIImage or CGImage) in the easy way.
let image = UIImage(named: "image_contains_faces")
image.face.crop { result in
  switch result {
  case .success(let faces):
    // When the `Vision` successfully find faces, and `FaceCropper` cropped it.
    // `faces` argument is a collection of cropped images.
  case .notFound:
    // When the image doesn't contain any face, `result` will be `.notFound`.
  case .failure(let error):
    // When the any error occured, `result` will be `failure`.
  }
}

Example

Example app screenshot

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

Installation

FaceCropper is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "FaceCropper"

Author

KimDarren, [email protected]

License

FaceCropper 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 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

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

Picture anonymiser using Vision face recognition

😃 Anonymojizer [WIP] Anonymize people in photos by replacing their faces by emojis. How to use it ? Pick a photo from the gallery Choose an emoji The

Simple command-line utility for performing OCR using Apple's Vision framework

ocrit Runs Vision's OCR on input images and outputs corresponding txt files for each image, or writes the recognized results to standard output. USAGE

An image download extension of the image view written in Swift for iOS, tvOS and macOS.
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Comments
  • Face rect detection

    Face rect detection

    To get the detected faces result.

    let image = UIImage(named: "image_contains_faces")
    image.face.detect { result in
      switch result {
      case .success(let rects):
        // rects: [CGRect]
      case .notFound:
        // no faces founded.
      case .failure(let error): 
        // any error occurred.
      }
    }
    
    TODO 
    opened by KimDarren 0
Owner
Taejun Kim
Taejun Kim
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
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
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
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
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

Croath Liu 779 Sep 1, 2022