All Projects → evermeer → Evfacetracker

evermeer / Evfacetracker

Licence: other
Calculate the distance and angle of your device with regards to your face

Projects that are alternatives of or similar to Evfacetracker

Multi-Face-Comparison
This repo is meant for backend API for face comparision and computer vision. It is built on python flask framework
Stars: ✭ 20 (-92.03%)
Mutual labels:  distance, face-detection
Facerecognition
Nextcloud app that implement a basic facial recognition system.
Stars: ✭ 226 (-9.96%)
Mutual labels:  face-detection
Arcface Multiplex Recognition
适用于复杂场景的人脸识别身份认证系统
Stars: ✭ 200 (-20.32%)
Mutual labels:  face-detection
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+930.68%)
Mutual labels:  face-detection
Face toolbox keras
A collection of deep learning frameworks ported to Keras for face analysis.
Stars: ✭ 202 (-19.52%)
Mutual labels:  face-detection
Wear A Mask
😷 An SPA that uses only the front-end to perform deep-learning-based facial landmark detection on images and automatically adds breathing mask stickers.
Stars: ✭ 226 (-9.96%)
Mutual labels:  face-detection
Viewfacecore
C# 超简单的人脸识别库。
Stars: ✭ 193 (-23.11%)
Mutual labels:  face-detection
Cnn face detection
Implementation based on the paper Li et al., “A Convolutional Neural Network Cascade for Face Detection, ” 2015 CVPR
Stars: ✭ 251 (+0%)
Mutual labels:  face-detection
Retinaface
The remake of the https://github.com/biubug6/Pytorch_Retinaface
Stars: ✭ 226 (-9.96%)
Mutual labels:  face-detection
Openseeface
Robust realtime face and facial landmark tracking on CPU with Unity integration
Stars: ✭ 216 (-13.94%)
Mutual labels:  face-detection
Paddledetection
Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Stars: ✭ 5,799 (+2210.36%)
Mutual labels:  face-detection
Face Dataset
Face related datasets
Stars: ✭ 204 (-18.73%)
Mutual labels:  face-detection
Tnn
TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and …
Stars: ✭ 3,257 (+1197.61%)
Mutual labels:  face-detection
Java String Similarity
Implementation of various string similarity and distance algorithms: Levenshtein, Jaro-winkler, n-Gram, Q-Gram, Jaccard index, Longest Common Subsequence edit distance, cosine similarity ...
Stars: ✭ 2,403 (+857.37%)
Mutual labels:  distance
Facepapercollection
A collection of face related papers
Stars: ✭ 241 (-3.98%)
Mutual labels:  face-detection
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (-20.72%)
Mutual labels:  face-detection
S3fd.pytorch
SFD implement with pytorch
Stars: ✭ 212 (-15.54%)
Mutual labels:  face-detection
Geokit
Geo-Toolkit for PHP.
Stars: ✭ 223 (-11.16%)
Mutual labels:  distance
Add Christmas Hat
Add Christmas hat on one's head based on OpneCV and Dlib
Stars: ✭ 251 (+0%)
Mutual labels:  face-detection
Stringsimilarity.net
A .NET port of java-string-similarity
Stars: ✭ 242 (-3.59%)
Mutual labels:  distance

EVFaceTracker

TL;DR: Use face detection for calculating distance and angle of your phone.

Build Status Issues Stars Version License Platform Documentation

Git Twitter LinkedIn Website eMail

Here is a demo where this is used for setting the shadow and size of a text.

Screenshot0

For a longer demo see: https://www.youtube.com/watch?v=yLAtc7AzjIk

Introduction

Earlier this month I had a discussion with a colleague about new forms of user interaction. On mobile devices there are now many applications that are using the compass and or accelerator. On a game consoles it’s very common to use a camera to interact with a game (Xbox Kinect and Playstation move) I thought it would be nice if we could use the front facing camera of a phone for interacting with an app. I had to see if this idea could be implemented.

Since iOS 5 Apple has added a face detection api. My idea was to detect a face and estimate the distance the device is from your face based on the size of the detected face. If the rectangle of the detected face is big, then the device is close to your face, if it’s small, then the device is far away from your face. With a similar technique it is also possible to calculate the angle of the device in relation to the face. This angle is calculated based on how fare the detected face rectangle is away from the center of the screen.

The challenge here was to hook into the video stream and detect the face for each frame. Fortunately Apple has a sample project for this called SquareCam. With the code from that project it’s possible to detect faces in about 5 frames per second (on an iPhone 4S)

There are a couple of fun things that you could do with face tracking:

  • Change the zoom level based on the distance.
  • Change the shadow offset based on the angle
  • ?

Using EVFaceTracker in your own App

'EVFaceTracker' is now available through the dependency manager CocoaPods. You can install cocoapods by executing:

[sudo] gem install cocoapods

If you have installed cocoapods, then you can just add EVFaceTracker to your workspace by adding the following line to your Podfile:

pod "EVFaceTracker"

You can also just copy EVFaceTracker.m and .h to your project.

The demo code:

- (void)viewDidLoad {
    [super viewDidLoad];
    // Start tracking your face.
    evFaceTracker = [[EVFaceTracker alloc] initWithDelegate:self];
    // And give us a smooth update 10 times per second.
    [evFaceTracker fluidUpdateInterval:0.1f withReactionFactor:0.5f];
}

#pragma mark - <EVFaceTrackerDelegate>
// This delegate method is called every time the face recognition has detected something (including change)
- (void)faceIsTracked:(CGRect)faceRect withOffsetWidth:(float)offsetWidth andOffsetHeight:(float)offsetHeight andDistance:(float) distance {
    [CATransaction begin];
    [CATransaction setAnimationDuration:0.2];
    CALayer *layer = dynamicLabel.layer;
    layer.masksToBounds = NO;
    layer.shadowOffset = CGSizeMake(offsetWidth / 5.0f, offsetHeight / 10.0f);
    layer.shadowRadius = 5;
    layer.shadowOpacity = 0.5;
    [CATransaction commit];
}

// When the fluidUpdateInterval method is called, then this delegate method will be called on a regular interval
- (void)fluentUpdateDistance:(float)distance {
    // Animate to the zoom level.
    float effectiveScale = distance / 60.0f;
    [CATransaction begin];
    [CATransaction setAnimationDuration:0.1f];
    [dynamicView.layer setAffineTransform:CGAffineTransformMakeScale(effectiveScale, effectiveScale)];
    [CATransaction commit];
}

License

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

My other libraries:

Also see my other open source iOS libraries:

  • EVReflection - Reflection based (Dictionary, CKRecord, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
  • EVCloudKitDao - Simplified access to Apple's CloudKit
  • EVFaceTracker - Calculate the distance and angle of your device with regards to your face in order to simulate a 3D effect
  • EVURLCache - a NSURLCache subclass for handling all web requests that use NSURLReques
  • AlamofireOauth2 - A swift implementation of OAuth2 using Alamofire
  • EVWordPressAPI - Swift Implementation of the WordPress (Jetpack) API using AlamofireOauth2, AlomofireJsonToObjects and EVReflection (work in progress)
  • PassportScanner - Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
  • AttributedTextView - Easiest way to create an attributed UITextView with support for multiple links (url, hashtags, mentions).
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].