All Projects → BeauNouvelle → Faceaware

BeauNouvelle / Faceaware

Licence: mit
An extension that gives UIImageView the ability to focus on faces within an image.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Faceaware

Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (-89.28%)
Mutual labels:  cocoapods, carthage, uiimageview
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (-60.72%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-98.97%)
Mutual labels:  extension, cocoapods, carthage
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (-90.35%)
Mutual labels:  cocoapods, carthage, uiimageview
Ezswiftextensions
😏 How Swift standard types and classes were supposed to work.
Stars: ✭ 2,911 (-3.1%)
Mutual labels:  extension, cocoapods, carthage
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (-82.09%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-98.14%)
Mutual labels:  hacktoberfest, extension, photos
Nextgrowingtextview
📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.
Stars: ✭ 1,540 (-48.74%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Amplitude Ios
Native iOS/tvOS/macOS SDK
Stars: ✭ 216 (-92.81%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Eureka
Elegant iOS form builder in Swift
Stars: ✭ 11,345 (+277.66%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Simplecheckbox
A simple Checkbox
Stars: ✭ 253 (-91.58%)
Mutual labels:  hacktoberfest, cocoapods, carthage
Facerecognition
Nextcloud app that implement a basic facial recognition system.
Stars: ✭ 226 (-92.48%)
Mutual labels:  hacktoberfest, face-detection, photos
FaceAware-Android
this helps to auto zoom for face on ImageView
Stars: ✭ 46 (-98.47%)
Mutual labels:  photos, face-detection, detect-faces
PyRecognizer
"A neural network to rule them all, a neural network to find them, a neural network to bring them all and verify if is you !!" (Face recognition tool)
Stars: ✭ 28 (-99.07%)
Mutual labels:  photos, face-detection
SwiftMan
Swift extensions and utils classes
Stars: ✭ 31 (-98.97%)
Mutual labels:  extension, carthage
Swiftytexttable
A lightweight library for generating text tables.
Stars: ✭ 252 (-91.61%)
Mutual labels:  cocoapods, carthage
Corestore
Unleashing the real power of Core Data with the elegance and safety of Swift
Stars: ✭ 3,254 (+8.32%)
Mutual labels:  cocoapods, carthage
facetool
Command line utility to manipulate faces in videos and images
Stars: ✭ 38 (-98.74%)
Mutual labels:  face-detection, detect-faces
Datez
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Stars: ✭ 254 (-91.54%)
Mutual labels:  cocoapods, carthage
Serpent
A protocol to serialize Swift structs and classes for encoding and decoding.
Stars: ✭ 281 (-90.65%)
Mutual labels:  cocoapods, carthage

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 AspectFill to fit the image to the bounds of a UIImageView without stretching or leaving whitespace, however when it comes to photos of people, it's quite often to have the faces cropped out if they're not perfectly centered.

This is where FaceAware comes in. It will analyse an image either through UIImageView's image property, or one you set using one of the built in functions and focus in on any faces it can find within.

The most common use for FaceAware is with avatars.

With FaceAware your users will no longer have to crop and adjust their profile pictures.

Based on these two older projects:

Both of which don't seem to be maintained anymore.

Requirements

  • Swift 5.1
  • iOS 8.0+
  • Xcode 11

Installation

Manual

Simply drag UIImageView+FaceAware.swift into your project.

Carthage

  • Add github "BeauNouvelle/FaceAware" to your Cartfile

More information on installing and setting up Carthage can be found here: https://github.com/Carthage/Carthage

Cocoapods

  • Add pod 'FaceAware' to your pod file.
  • Add import FaceAware to the top of your files where you wish to use it.

Usage

There are a few ways to get your image views focussing in on faces within images.

Interface Builder

This is the easiest method and doesn't require writing any code. The extension makes use of @IBDesignable and @IBInspectable so you can turn on focusOnFaces from within IB. However you won't actually see the extension working until you run your project.

Code

You can set focusOnFaces to true.

someImageView.focusOnFaces = true

Be sure to set this after setting your image. If no image is present when this is called, there will be no faces to focus on.


Alternatively you can use:

someImageView.set(image: myImage, focusOnFaces: true)

Which elimates the worry of not having an image previously set.


You can also recieve a callback for when face detection and any image adjustments have been completed by passing in a closure to the didFocusOnFaces property.

someImageView.didFocusOnFaces = {
     print("Did finish focussing")
}

Debugging

FaceAware now features a debug mode which draws red squares around any detected faces within an image. To enable you can set the debug property to true.

someImageView.debug = true

You can also set this flag within interface builder.

More help? Questions?

Reach out to me on Twitter @beaunouvelle Also, if you're using this in your project and you like it, please let me know so I can continue working on it!

Future Plans

  • Add an option to only focus on largest/closest face in photo.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].