Ken Burns effect with face recognition!

Overview

APKenBurnsView

APKenBurnsView

Build Status Version License Platform

Ken Burns effect with face recognition!

APKenBurnsView is UIView subclass which supports face recognition to beautifully animate people photos.

APKenBurnsView

Features

  • Face recognition feature to beautifully animate people photos.
  • Totally random algorithm. No more hardcoded values!
  • Memory efficient. Holds maximum of two UIImage pointers at any moment.
  • Pausing animations done right.
  • Auto restart after entering background and returning back.
  • A lot of animation customizations to fit your needs.

Face Recognition

APKenBurnsView supports three modes for face recognition:

  • None - no face recognition, simple Ken Burns effect.
  • Biggest - recognizes biggest face in image, if any then transition will start or finish (chosen randomly) in center of face rect.
  • Group - recognizes all faces in image, if any then transition will start or finish (chosen randomly) in center of compound rect of all faces.

Usage

Just simple interface. Provide data source class for UIImage's, setup all timings and run startAnimations(). No rocket science!

Data source should be ready to provide next image at the moment when APKenBurnsView calls func nextImageForKenBurnsView(kenBurnsView: APKenBurnsView) -> UIImage?. If there is no UIImage ready (still loading from network, etc.) then data source should return nil and APKenBurnsView will animate last image one more time. If you are loading your images from network you should consider some preloading mechanism.

Example of usage:

class MyViewController: UIViewController {
    // MARK: - Outlets 
    @IBOutlet weak var kenBurnsView: APKenBurnsView!

    // MARK: - Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()

        kenBurnsView.dataSource = self
        kenBurnsView.faceRecognitionMode = .Biggest
        
        kenBurnsView.scaleFactorDeviation = 0.5
        kenBurnsView.imageAnimationDuration = 5.0
        kenBurnsView.imageAnimationDurationDeviation = 1.0
        kenBurnsView.transitionAnimationDuration = 2.0
        kenBurnsView.transitionAnimationDurationDeviation = 1.0
    }

    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)

        self.kenBurnsView.startAnimations()
    }
}
    
extension KenBurnsViewController: APKenBurnsViewDataSource {
    func nextImageForKenBurnsView(kenBurnsView: APKenBurnsView) -> UIImage? {
        return /* Provide UIImage instance */
    }
}

Example

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

Requirements

  • iOS 8.0 and higher
  • ARC

Installation

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

pod 'APKenBurnsView'

Author

Nickolay Sheika, [email protected]

Contacts

If you have improvements or concerns, feel free to post an issue and write details.

Check out all Alterplay's GitHub projects. Email us with other ideas and projects.

License

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

You might also like...
CoreML-Face-Parsing - how to use face-parsing CoreML model in iOS
CoreML-Face-Parsing - how to use face-parsing CoreML model in iOS

CoreML-Face-Parsing The simple sample how to use face-parsing CoreML model in iO

🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!
🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!

Hands I have always been interested in how I can improve my memory in addition to reading books, and once I came across an interesting technique relat

iOS association game chatbot. AI based on neural word embedding language model. Image recognition with convolutional neural net.
iOS association game chatbot. AI based on neural word embedding language model. Image recognition with convolutional neural net.

AssociationBot ##iOS association game chatbot. UI based on JSQMessagesDemo. Association database created with the help of Word2Vec neural word embeddi

iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!
iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!

Developed and Maintained by Ipodishima Founder & CTO at Wasappli Inc. (If you need to develop an app, get in touch with our team!) So what is this lib

Real-Time image recognition for iOS with Vision(CoreML) and InceptionV3
Real-Time image recognition for iOS with Vision(CoreML) and InceptionV3

Kesan-ML-iOS Real-Time image recognition for iOS with CoreML and InceptionV3  Test Flight Description Real-Time image recognition Integrating app wit

CLI tool for macOS that transcribes speech from the microphone using Apple’s speech recognition API, SFSpeechRecognizer. (help.)
CLI tool for macOS that transcribes speech from the microphone using Apple’s speech recognition API, SFSpeechRecognizer. (help.)

CLI tool for macOS that uses SFSpeechRecognizer to transcribe speech from the microphone. The recognition result will be written to the standard output as JSON string.

A speech recognition framework designed for SwiftUI.
A speech recognition framework designed for SwiftUI.

SwiftSpeech Speech Recognition Made Simple Recognize your user's voice elegantly without having to figure out authorization and audio engines. SwiftSp

Hand-gesture recognition on iOS app using CoreML
Hand-gesture recognition on iOS app using CoreML

GestureAI-CoreML-iOS Hand-gesture recognizer using CoreML Demo Screenshots This app is using RNN(Recurrent Neural network) with CoreML on iOS11. The m

This project is Text Recognition using Firebase built-in model on iOS
This project is Text Recognition using Firebase built-in model on iOS

TextRecognition-MLKit This project is Text Recognition using Firebase built-in model on iOS. If you are interested in iOS + Machine Learning, visit he

QR code detector. Simple usage, you can get recognition results via delegate or callback.

SPQRCode QR code detector. Simple usage, you can get recognition results via delegate or callback. Installation Swift Package Manager CocoaPods Manual

Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime.
Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime.

Sample iOS AR app that demonstrates how to capture the texture of a user's face in realtime. This texture can be used to create a simple textured 3D face model.

A pet project to train my kids to read analog clock face.
A pet project to train my kids to read analog clock face.

What Time A tiny side project for my kids. 🥰 My kids are not good at reading analog clock, so I decided to build an app for them to practice again an

This library uses ARKit Face Tracking in order to catch user's smile.
This library uses ARKit Face Tracking in order to catch user's smile.

SmileToUnlock Make your users smile before opening the app :) Gif with the demonstration Installation Cocoapods The most preferable way to use this li

Turn a photo of your food into a face
Turn a photo of your food into a face

Megabite Megabite is a mobile app that automatically turns a photo of your food into a face. Read more about it here. Installation This project uses C

A simple project for Face ID Authentication for iOS device using LocalAuthentication Framework

BiometricAuthentication This respository is a simple project for Face ID Authentication for iOS device using LocalAuthentication Framework and infoPli

An iOS framework that uses the front camera, detects your face and takes a selfie.
An iOS framework that uses the front camera, detects your face and takes a selfie.

TakeASelfie An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front camera and draws an green oval

WebViewCustomFont - WKWebView extension to addScript for inject a custom font-face
WebViewCustomFont - WKWebView extension to addScript for inject a custom font-face

WebViewCustomFont WKWebView extension to addScript for inject a custom font-face

Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks

mtcnn-caffe Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks. This project provide you a method to update mu

Comments
  • Swift 3.0 Support/Style

    Swift 3.0 Support/Style

    Let me know if anything looks off. Usually people bump a major version for Swift 3 support. Even if you weren't ready for 1.0 might be a good idea. If all looks good merge and publish 👍

    opened by gregpardo 2
  • xcode 8.3 swift 3 warnings

    xcode 8.3 swift 3 warnings

    There are warnings in the latest xcode 8.3:

    FacesDrawer.swift:30:23: 'global(priority:)' was deprecated in iOS 8.0 FacesDrawer.swift:30:74: 'default' was deprecated in iOS 8.0: Use qos attributes instead

    DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async {

    RuntimeProperties.swift:21:33: Conditional cast from 'T' to 'AnyObject' always succeeds

    func setAssociatedObject<T>(_ object: AnyObject, value: T, associativeKey: UnsafeRawPointer, policy: objc_AssociationPolicy) {
        if let v: AnyObject = value as? AnyObject {
    
    opened by alexookah 1
  • Image Starts with Out Of Bounds

    Image Starts with Out Of Bounds

    Check the screenshot from my app. In iPhone 7 plus Simulator it starts with out of bounds.. grey Border on the right. The next images do not start out of bounds. Is there an option missing to start the image inside image's bounds?

    opened by alexookah 1
  • XCode 11.5 SwiftUI build error. 'optional' requirements are an Objective-C compatibility feature; add '@objc'

    XCode 11.5 SwiftUI build error. 'optional' requirements are an Objective-C compatibility feature; add '@objc'

    this line : optional func kenBurnsViewDidFinishTransition(kenBurnsView: APKenBurnsView) this error : optional' requirements are an Objective-C compatibility feature; add '@objc'

    Screen Shot 2020-07-03 at 12 30 58

    opened by steve111MV 1
Owner
Alty
Custom Multi-Platform Digital Products
Alty
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

js_john 11 Aug 20, 2022
Turn a photo of your food into a face

Megabite Megabite is a mobile app that automatically turns a photo of your food into a face. Read more about it here. Installation This project uses C

Aaron Randall 361 Oct 26, 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
Reconstruct a 3D face with RGB-D images captured by iPhone X's TrueDepth camera.

!TrueDepth camera can only be accessed on iPhone X or later. TODO Get the RGB-D files (This repository) Generate 3D face mesh with landmark detector a

null 14 Nov 18, 2022
You can use blur effect and it's animation easily to call only two methods.

SABlurImageView You can use blur effect and it's animation easily to call only two methods. ManiacDev.com referred. https://maniacdev.com/2015/04/open

Taiki Suzuki 555 Dec 17, 2022
A lightweight 3D Linear Carousel with parallax effect

TGLParallaxCarousel A lightweight 3D Linear Carousel with parallax effect [GIF] Threedimensional & Normal mode Installation TGLParallaxCarousel is ava

Matteo Tagliafico 440 Dec 17, 2022
Face detection and recognition iOS app with OpenCV

Facemotion Facemotion it's an iOS app, allowing you to find easily a contact by face recognition. Scan the face of a person, whether the contact is in

Remi ROBERT 170 Nov 15, 2022
:eyes: Face detection and recognition iOS app with OpenCV

Facemotion Facemotion it's an iOS app, allowing you to find easily a contact by face recognition. Scan the face of a person, whether the contact is in

Remi ROBERT 170 Nov 15, 2022
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

Kaww 1 Dec 20, 2021
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

js_john 11 Aug 20, 2022