Git Product home page Git Product logo

visiondetect's Introduction

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 :)

Check Example Project.

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.

vDetect.addTakenImageChangeHandler { (image) in
    self.imageView.image = image
    self.vDetect.saveTakenImageToPhotos()
}

Requirements

  • iOS 11.0+
  • Xcode 11+
  • Swift 5.0+

Installation

CocoaPods

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

platform :ios, '11.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

Check out the Carthage docs on how to add a install. The VisionDetect framework is already setup with shared schemes.

Carthage Install

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate VisionDetect into your Xcode project using Carthage, specify it in your Cartfile:

github "miletliyusuf/VisionDetect"

Manually

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

Usage example

import VisionDetect

class VisionDetectViewController: UIViewController {

    @IBOutlet private weak var imageView: UIImageView!

    var vDetect = VisionDetect(
        cameraPosition: .FaceTimeCamera,
        optimizeFor: .HigherPerformance
    )

    override func viewDidLoad() {

        super.viewDidLoad()

        vDetect.delegate = self
        vDetect.onlyFireNotificatonOnStatusChange = true
        vDetect.beginFaceDetection()

        vDetect.addTakenImageChangeHandler { (image) in
            self.imageView.image = image
            self.vDetect.saveTakenImageToPhotos()
        }

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

extension VisionDetectViewController: VisionDetectDelegate {

    func didLeftEyeClosed() {

        vDetect.takeAPicture()
    }
}

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.