Skip to content

Getting started

Will Crichton edited this page Mar 30, 2017 · 14 revisions

For an interactive walkthrough of the Scanner API, check out our IPython notebook. Continue below for a more in-depth discussion of the Scanner model and design.

1. System overview

To understand how Scanner supports efficient video analysis at scale, we will briefly explore its data model and computation model.

Data model: tables

In Scanner, data is organized like a traditional database into tables. A Scanner database holds a set of tables. When you ingest a set of videos into a Scanner database, they are represented as tables where each frame is a row in a table.

When you run a computation in Scanner, you will produce more tables. For example, let's say you ingest a video with 1000 frames, which creates a table with 1000 rows. If you use Scanner to compute a color histogram for each frame of that video, then that corresponds to a new table with 1000 rows and a single column for the computed histogram.

Note that although a video is logically represented as each frame existing separately in its own row, Scanner does not decompress videos into such a representation. Instead, whenever a computation needs to read a particular row (or frame) from a video table, Scanner will decode those frames from the compressed H.264 representation on the fly.

Computation model: dataflow graphs

Much like TensorFlow, Scanner represents computations as dataflow graphs, where each node in the graph is a function and edges are data that flow between the functions. These nodes, called operators (or ops), are functions that take rows of a table as input, and produce rows of a table as output. They can run on either the CPU or GPU, as specified by the user. For example, a pipeline that uses a deep neural network to estimate the pose of a person in frames of a video has the following linear dataflow graph:

Scanner takes these dataflow graphs and executes them on a cluster of machines, loading videos from and saving results to the Scanner database.

2. Code tutorial

This assumes you have already built Scanner. See Building Scanner for instructions on doing so.

To learn how to use Scanner in practice, begin by looking through the tutorial files in scanner/examples/tutorial, starting with tutorial/00_basic.py. These files explain the basics of using Scanner to ingest/organize videos and run computations, as well as define your own custom operators.

Once you're familiar with the basics, take a look through the other examples in the scanner/examples directory. We have Scanner examples for:

  • Caffe - deep neural networks
  • Halide - high performance image processing kernels

3. Documentation

For full API documentation, visit here: Documentation.