Andrea Alvarez Rodriguez e Thomas Maragno - Implementando reconhecimento facial usando Java e Oracle...

49

Transcript of Andrea Alvarez Rodriguez e Thomas Maragno - Implementando reconhecimento facial usando Java e Oracle...

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

June 28–30, 2016São Paulo

JavaOneSES12228 Implementing “Fast and FuriouFastData and Cloud Platforms God’s Eye” with Oracle’sitle

Andrea AlvarezSolution SpecialistOracle Costa Rica

Thomas MaragnoSales ConsultantOracle Caribbean

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 4

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 5

What is the “God’s Eye”?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 6

What is the “God’s Eye”?

• A pen drive?• A SD Card?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 7

What is the “God’s Eye”?

• Piece of code created by Ramsey

• “Is able to hack any type of technology.”

• Can take control of their camera

• Returns the information gathered in less than 4 min

• Can locate any given person anywhere in the world.

• It can be taken over by anyone

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Demo

Oracle Confidential – Internal/Restricted/Highly Restricted 8

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 9

Demo

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 10

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 12

High Level Steps

Detected facesand crop image

Live Feed

Process facesand try to recognize

the subject

Correlate datawith static known

data

Consume correlated data from queueShow live feed

1

2a

2b3

JMS Q JMS Q

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Edge Analytics

Oracle Confidential – Internal/Restricted/Highly Restricted 13

Used Components

Compute CS/DevCS JCS/DevCS

Stream Analytics

Database CS POI DB

JET AppVia JMSVia JMS

SE Embedded

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle Edge Analytics

Oracle Confidential – Internal/Restricted/Highly Restricted 14

“Oracle OEA (formerly known as Event Processing) is a Java serverfor the development of high-performance event drivenapplications on embedded devices. It is a lightweight Javaapplication container based on Equinox OSGi, with sharedservices, including the Oracle CEP Service Engine, which provides arich, declarative environment based on Oracle Continuous QueryLanguage (Oracle CQL).”

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 16

Adapter Channel

Processor/Query Event

1 Face DetectionConcepts

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 17

1 Face Detection

CEP Engine

Query

Query

Inp

ut

Ad

apte

rs

Ou

tpu

t A

dap

ters

event

event

event

Real-time event data Context-aware filtering, correlation, aggregation and processing of data

Processed business events for downstream applications

event

event

eventSensors

Backend Applications

High Level Architecture

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 18

1. Face Detection

Tap into the camera

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

1 Face Detection• Implements RunnableBean

and StreamSource Interfaces

• Convert data coming from physical devices to OEA Events

• Convert OEA Events

• Future Plans: Replace with IoTCS

Oracle Confidential – Internal/Restricted/Highly Restricted 19

Video Adapter

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 20

1. Face Detection

Send the live feed downstream.

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 21

1. Face Detection

Clean events. Discard errors and duplicates

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

1. Face Detection• Implements RunnableBean

and StreamSource Interfaces

• Convert data coming from physical devices to OEA Events

• Convert OEA Events

• Future Plans: Replace with IoTCS

Oracle Confidential – Internal/Restricted/Highly Restricted 22

CQL / Processor

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 23

1. Face Detection

Destination: JMS Q

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

1. Face Detection• JMS Adapter not implemented

in Edge Analytics

• Custom JMS Adapter built

• Implements StreamSinkInterface

• Convert OEA Event to MapMessage

• Future Plans: Replace with IoTCS

Oracle Confidential – Internal/Restricted/Highly Restricted 24

Custom JMS Adapter

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

JMS Q JMS Q

Oracle Confidential – Internal/Restricted/Highly Restricted 25

High Level Steps

Detected facesand crop image

Live Feed

Process facesand try to recognize

the subject

Correlate datawith static known

data

Consume correlated data from queueShow live feed

1

2a

2b3

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Edge Analytics

Oracle Confidential – Internal/Restricted/Highly Restricted 26

Used Components

Compute CS/DevCS JCS/DevCS

Stream Analytics

Database CS POI DB

JET AppVia JMSVia JMS

SE Embedded

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 27

2a. Face Recognition

Standard OOTB pre built JMS Adapter

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 28

2a and 2b. Face Recognition and Correlation

Actual face recognition occurs here

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 29

“OpenCV is one of the most popular libraries used to develop ComputerVision applications. It enables us to run many different Computer Visionalgorithms in real time. It has been around for many years, and it hasbecome the standard library in this field. One of the main advantages ofOpenCV is that it is highly optimized and available on almost all theplatforms.”

Authors of OpenCV By ExamplePrateek Joshi; David Millán Escrivá; Vinícius Godoy

What is OpenCV

2a and 2b. Face Recognition and Correlation

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

2a and 2b. Face Recognition and Correlation

Oracle Confidential – Internal/Restricted/Highly Restricted 30

Detecting objects and or Recognizing faces – implemented process

Haarcascades

Training image set

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 31

2 Face Recognition

Discard low confidence recognitions

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 32

2 Face Recognition

Send downstream (JMS) for JET App Consumption

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 33

2 Face Recognition

Testing purpose. Write event to CSV

Steps

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

JMS Q JMS Q

Oracle Confidential – Internal/Restricted/Highly Restricted 34

High Level Steps

Detected facesand crop image

Live Feed

Process facesand try to recognize

the subject

Correlate datawith static known

data

Consume correlated data from queueShow live feed

1

2a

2b3

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Edge Analytics

Oracle Confidential – Internal/Restricted/Highly Restricted 35

Used Components

Compute CS/DevCS JCS/DevCS

Stream Analytics

Database CS POI DB

JET AppVia JMSVia JMS

SE Embedded

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 36

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

3 Consume Messages from JET

• Collection of Open Source and Oracle-built JavaScript Libraries

• Rich Component Set with Oracle Data Visualization

• Alta Theme Built-in

• Oracle Standards Compliant

• Security.

• Common Model API.

• Unique features for mobile apps development.

• Internationalization.

JET JQuery JQueryUI Knockout RequireJS Hammer

What is JET?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

3 Consume Messages from JET

• Use of Model-View-ViewModel (MVVM) architecture– Better organized code by isolating logic for managing a specific part of the UI

– Natural point for plugging in View Unit Tests

– Enables automatic View updates in response to data changes and user input, reducing the quantity of business logic (or glue) required in the code

– Enables designer-developer workflow due to loose coupling between View markup & code behind

• Use two-way data binding to ease development

38

What is JET?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle JET for FaceRecon app

39

Users

RESTADF Backend

JMS Queue

Server Side

Client Browser

JET Common Model

HTTP/JSON

Google Maps Third-party Cloud API

Mobile/Web FaceReconApplication

JCS/DevCS

Business Services

Data

Model

Knockout.JS ViewModel

View

Re

qu

ireJS

JET UI Components

JQueryUI Hammer Alta UI Theme

JET rou

ting

system

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 40

Future Plans

Detected facesand crop image

Live Feed

Process facesand try to recognize

the subject

Correlate datawith static known

data

Consume correlated data from queueShow live feed

Store videoSegments in hadoop

for analysis

JMS Q JMS Q

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 41

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Unlocking Value of IoT Data via Analytics & Integration

Time

Bu

sin

ess

Val

ue

Act Now

HOTSchedule

Maintenance

WARMPlan for

next release

COLD

42

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Working with Big Data: some challenges

1. Big data ≠ Infinite storageYes, storage is cheap but it helps to have clean data, with context and less redundancy

2. Hadoop is batch-oriented and there is inherent latency "With the paths that go through Hadoop [at Yahoo!], the latency is about fifteen minutes […] it will never be true real-time. " *Raymie Stata, Yahoo! CTO(June 2011)

*: http://www.theregister.co.uk/2011/06/30/yahoo_hadoop_and_realtime/

minutes

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Get ahead of the curve

1. Filter out noise (ex: data ticks with no change), add context (by correlating multiple sources), increase relevance

2. Identify certain critical conditions as you insert data in warehouse

Move time-critical analysis to front of process

Filter out, correlate

Use Event Processing techniques

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Getting Ahead of the Curve

Fast Data

Big Data

minutesms

Fast Data

His

tori

cal d

epth

: dee

p

His

tori

cal d

epth

: sh

allo

w

Example: analysis of traffic patterns and congestion times for urban planning

Example: monitoring of traffic cameras to ensure given license plates are not in use on multiple vehicles Add “depth” to your fast data by merging output

of MapReduce to stream processing

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 46

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Use Case: City Automation & Traffic Management

•Automatic number

plate recognition

•Red-light violation

detection

•Traffic jam detection

•Vehicle location

system

•Geo-fences

Source: http://www.flickr.com/photos/epsos/5591761716/

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Use Case: Remote Patient Monitoring

•Data evaluation for

potential health

problems

•Automatic alerts to

caregivers and

healthcare providers

•Historical data analysis

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Use Case: Home Automation

•Real-time pricing with

adaptive intelligence for

carbon footprint

reduction

•Automatic water usage

metering enables

conservation

• Intrusion detection

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 50

Questions?

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 51