Latest 0.0.7
Homepage https://github.com/miletliyusuf/VisionDetect
License MIT
Platforms ios 8.0
Authors

VisionDetect

VisionDetect let you track user face gestures like blink, smile etc.

Swift Version
Build Status
License
Carthage compatible
CocoaPods Compatible
Platform
PRs Welcome

Inspired from https://github.com/aaronabentheuer/AAFaceDetection , added some new features(like take a photo) and will add in near future. Moved from KVO to Delegation structure to easy use :)

Delegate Methods

    func didNoFaceDetected()
    func didFaceDetected()
    func didSmile()
    func didNotSmile()
    func didBlinked()
    func didNotBlinked()
    func didWinked()
    func didNotWinked()
    func didLeftEyeClosed()
    func didLeftEyeOpened()
    func didRightEyeClosed()
    func didRightEyeOpened()

Features

You can easily take a picture or save it to photo album.

    self.vDetect.takeAPicture(completionHandler: { (image) in

    })
    self.vDetect.saveToCamera()

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

CocoaPods

You can use CocoaPods to install VisionDetect by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'VisionDetect', :git=>'https://github.com/miletliyusuf/VisionDetect.git'

To get the full benefits import VisionDetect wherever you import UIKit

import VisionDetect

Carthage

Create a Cartfile that lists the framework and run carthage update. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/VisionDetect.framework to an iOS project.

github "miletliyusuf/VisionDetect"

Manually

  1. Download and drop VisionDetect.swift in your project.
  2. Congratulations!

Usage example

import VisionDetect

class YourViewController: UIViewController {

    @IBOutlet weak var imageView:UIImageView!

    var vDetect:VisionDetect!

    override func viewDidLoad() {
        super.viewDidLoad()

        vDetect = VisionDetect(cameraPosition: VisionDetect.CameraDevice.FaceTimeCamera, optimizeFor: VisionDetect.DetectorAccuracy.HigherPerformance)
        vDetect.delegate = self
        vDetect.onlyFireNotificatonOnStatusChange = false
        vDetect.beginFaceDetection()

        self.view.addSubview(vDetect.visageCameraView)
    }
}

extension YourViewController: VisionDetectDelegate {
    func didLeftEyeClosed() {
        self.vDetect.takeAPicture(completionHandler: { (image) in
            self.imageView.image = image
            self.vDetect.endFaceDetection()
            self.vDetect.visageCameraView.removeFromSuperview()
        })
    }
}

Contribute

We would love you for the contribution to VisionDetect, check the LICENSE file for more info.

Meta

Yusuf Miletli – @ysfmltli[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/miletliyusuf/VisionDetect

Latest podspec

{
    "name": "VisionDetect",
    "version": "0.0.7",
    "summary": "VisionDetect let you track user face gestures like blink, smile etc.",
    "description": "Inspired from https://github.com/aaronabentheuer/AAFaceDetection , added some new features(like take a photo) and will add in near future. Moved from KVO to Delegation structure to easy use :)",
    "homepage": "https://github.com/miletliyusuf/VisionDetect",
    "license": "MIT",
    "authors": {
        "Yusuf Miletli": "[email protected]"
    },
    "social_media_url": "https://twitter.com/ysfmltli",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/miletliyusuf/VisionDetect.git",
        "tag": "0.0.7"
    },
    "source_files": [
        "VisionDetect",
        "VisionDetect/**/*.{h,m}"
    ],
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This