Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

"Johnny" (CEP)

Eron Wright edited this page Apr 11, 2017 · 3 revisions

WikiJohnny (CEP)

Introduction

The Johnny demo simulates a security system that relies on an image-based access code. The idea is that an input stream is monitored for images; if a specific series of images is seen in quick succession, access is granted. The idea came from a classic cyberpunk movie ref.

A TensorFlow model called 'Inception v5' is used to identify the content of images.

Building

Build the flink-tensorflow-examples project:

$ mvn package

This will produce a JAR file suitable for deployment to a Flink cluster.

Running

Start by creating a directory that you'll save images to. Once you run the example, it will monitor that directory for new images, with the expectation of seeing three images in succession:

  1. a 'cheeseburger'
  2. a 'ladybug'
  3. a 'llama'

Next, download and extract the inception5h model:

$ wget http://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip
$ unzip inception5h.zip

Next, run the example in a Flink cluster.

$ flink run -c \
  org.apache.flink.contrib.tensorflow.examples.inception.Johnny \
  flink-tensorflow-examples/target/flink-tensorflow-examples_2.11-0.1-SNAPSHOT.jar \
  /path/to/inception5h \
  /path/to/photos

Finally, browse to the 'stdout' from the TaskManager(s) in your Flink cluster to find the program output.

Clone this wiki locally