Face recognition

39
Template designed by Face Recognition using C# Matteo Valoriani [email protected] @matteovaloriani Luigi Oliveto [email protected] @luigioliveto

Transcript of Face recognition

Page 1: Face recognition

Template designed by

Face Recognition using C#Matteo [email protected]@matteovaloriani

Luigi [email protected]@luigioliveto

Page 2: Face recognition

Matteo Valoriani

CEO of Fifth ElementSpeaker and ConsultantPhD at Politecnico of Milano

Microsoft MVP

Intel Software Innovator

email: [email protected]: @MatteoValorianilinkedin: https://it.linkedin.com/in/matteovaloriani

Nice to Meet You

2

Page 3: Face recognition

Luigi Oliveto

DeveloperCo-SpeakerMaster of Science at Politecnico of Milano

email: [email protected]: @LuigiOlivetolinkedin: https://it.linkedin.com/in/luigioliveto

Nice to Meet You

3

Page 4: Face recognition

Face Detection vs Face Recognition vs Face Identification

Face Analysis HomeMade• OpenCV/Emgu

Face Analysis with Cloud Services• BetaFace

• Microsoft Face API

Face Analysis with Special Camera• Kinect

• RealSense

Conclusions• Common Problems and Limits

Agenda

Page 5: Face recognition

Detection vs Analysis vs Recognition

Page 6: Face recognition

Face detection is a computer technology that identifies human faces in digital images.

 

Face Detection

Facial Point DetectionFace Detection/Tracking

Page 7: Face recognition

Face Analysis is a computer technology that analyze human faces in digital images and elaborate physical and emotional characteristics.

 

Face Analysis

Gender/Age/Race AnalysisEmotion Analysis

Page 8: Face recognition

Facial recognition system is a computer application for automatically identifying or verifying a person from a digital image or a video frame from a video source.

 

Face Recognition

Face Similarity/GroupingFace Verification Face Identification

Page 9: Face recognition

Face Analysis Home Made

OpenCV/Emgu

Page 10: Face recognition

Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.

What is EMGU

Page 11: Face recognition

The basic layer (layer 1) contains function, structure and enumeration mappings which directly reflect those in OpenCV.

The second layer (layer 2) contains classes that mix in advantanges from the .NET world.

EMGU Architecture

Page 12: Face recognition

To start with you need to reference 3 EMGU DLL’s. 

• Emgu.CV.dll

• Emgu.CV.UI.dll 

• Emgu.Util.dll  

using Emgu.CV;

using Emgu.Util;

using Emgu.CV.Structure;

Create a project with EMGU

Page 13: Face recognition

cudart64_32_16.dll  cufft64_32_16.dll cvextern.dll npp64_32_16.dll opencv_calib3d220.dll opencv_contrib220.dll opencv_core220.dll  opencv_features2d220.dll opencv_flann220.dll opencv_gpu220.dll opencv_highgui220.dll opencv_imgproc220.dll opencv_legacy220.dll opencv_ml220.dll opencv_objdetect220.dll opencv_video220.dll 

 Add > Existing Item

Page 14: Face recognition

The goal of statistical classification is to use an object's characteristics to identify which class (or group) it belongs to.

An object's characteristics are also known as feature values and are typically presented to the machine in a vector called a feature vector.

Machine Learning Classifier

Page 15: Face recognition

Supervised Learning Model

Page 16: Face recognition

OpenCV/EmguCV uses a type of face detector called a Haar Cascade.

The Haar Cascade is a classifier (detector) trained on thousands of human faces.

This training data is stored in an XML file, and is later used by the classifier during detection.

It’s the easiest ready to use face detection method which is supported by OpenCV/EmguCV and has great results.

Haar Feature-based Cascade Classifier

Page 17: Face recognition

The Fisher Classifier is a linear classifier.

A linear classifier achieves this by making a classification decision based on the value of a linear combination of the characteristics.

The Fisher Classifier

Page 18: Face recognition

dem

o Smile

Page 19: Face recognition

Face Analysis with Cloud ServicesBetaFacehttp://betaface.com/

Page 20: Face recognition

SDK for Private Cloud Configuration

WebAPI for Public Cloud

BetaFace APIs

Page 21: Face recognition

General face info: - faces (positions, sizes, angles) - face landmarks locations (22 basic, 101 pro) - cropped face images - gender, age, ethnicity, smile, glasses, mustache and beard detection 

Extended measurements: - face and facial features shapes description - hair and skin color - facial hair detection - approximate hairstyle shape - background color and clothes color. 

BetaFace - Metadata

Page 22: Face recognition

Following functions supported: - upload image file or submit image url - retrieve image and face metadata, including cropped face image - compare single faces or groups of faces and receive similarity confidence along with match decision. - transform face image(s) - generate averages from two or more faces, change face expression or otherwise modify them. - add user defined metadata tags, store user-adjusted points and face info. 

BetaFace - Metadata

Page 23: Face recognition

JSON/XML response

Page 24: Face recognition

JSON/XML response<FaceInfo>

<angle>3.3149</angle>

<height>78.05</height>

<image_uid>2bdcd1ad-47a6-45f8-ba74-86c765272422</image_uid>

<points>

<PointInfo>

<name>basic eye left</name>

<type>512</type>

<x>313.82</x>

<y>48.88</y>

</PointInfo>

</points>

<score>4.81</score>

<tags>

<TagInfo>

<confidence>0.07</confidence>

<name>age</name>

<value>31</value>

</TagInfo>

….

< /tags >

22 Points (Basic mode)101 Points (Advanced Mode)

Basic:Age - approximate age value beard - yes, no gender - male, female glasses - yes, no mustache - yes, no smile - yes, no race - asian-middle-eastern, asian, african-american, hispanic, white, middle eastern, other

Page 25: Face recognition

1. Get XML string

2. Generate XSD• https://devutilsonline.com/xsd-xml/generate-xsd-from-xml

3. Generate C# classes• XML Schema Definition Tool (Xsd.exe)

Create C# Classes from XML

Page 26: Face recognition

From XML to XSD

Page 27: Face recognition

https://msdn.microsoft.com/en-us/library/x6c1kb0s(v=vs.110).aspx

From XSD to Class

Page 28: Face recognition

FREE: Current public API key limits: faces search/recognition requests - no limits; new images - 500 images per day (15000 images per month); Same image with different set of processing flags counts as new image; images in processing queue - 500; transform requests - no limits. 

Freemium: 0 EUR/month 500 IMAGE /day, 0.035 EUR extraBasic: 199 EUR/month 40000 IMAGE/month 0.025 EUR extraPremium: 399 EUR/month 100000 IMAGE/month 0.02 EUR extra.

IMAGE – Each new image processed via UploadImage, UploadNewImage_File or UploadNewImage_Url functions. - uploading the same image with different detection_flags counts as IMAGE.- uploading the same image with the same set of detection_flags while previous processing results are still in cache does not count as IMAGE.- no restrictions on recognize, GetRecognizeInfo or GetImageInfo requests; no restrictions on number of namespaces or their size

If you like to subscribe to one of those plans send email to [email protected] with your details for invoice and plan you selected. We will send you your personal API key. 

Current data storage policy: Source images are removed from cache shortly after processing. Faces that have no person/namespace assigned and corresponding image metadata usually cleaned up after 10 days (face IDs and image IDs will be invalidated). 

Licensing: Free VS PRO

Page 30: Face recognition

Face Analysis with Cloud ServicesProject Oxfordhttp://www.projectoxford.ai/

Page 31: Face recognition

Face Detection

Face Recognition• Face Verification

• Similar Face Searching

• Automatic Face Grouping

• Person Identification

Project Oxford Services

Page 32: Face recognition

Powered by Azure

Page 33: Face recognition

1. Access the Project Oxford Portal https://www.projectoxford.ai, and then click on the "Sign up" button.

2. Sign in with your Microsoft account, or Sign up for a new Azure subscription if you don't already have one.

3. Go down the list to select an offered service such as "Face APIs" from the list, and then click through the various windows in order to make a purchase.

4. Click on the item to view the dashboard, and at the bottom of the page, click on the 'Manage' button to go to the 'Developer Manage Keys' page.

5. Finally, Copy or regenerate subscription keys in the page.

Get Start

Page 34: Face recognition

dem

o Smile

Page 35: Face recognition

Face Analysis with Special CamerasKinect ONE

Page 36: Face recognition

Face Analysis with Special CamerasReal Sense F200

Page 37: Face recognition

dem

o Smile

Page 38: Face recognition

Q&A

Page 39: Face recognition

Grazie a tutti per la partecipazione

Riceverete il link per il download a slide e demo via email nei prossimi giorni

Per contattarmi

[email protected]

[email protected]

Grazie