GithubHelp home page GithubHelp logo

hxl1990 / scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scanner-research/scanner

0.0 2.0 0.0 48.09 MB

Efficient video analysis at scale

License: Apache License 2.0

CMake 8.50% Shell 1.23% Python 11.46% C++ 74.65% Protocol Buffer 1.21% Cuda 2.87% C 0.09%

scanner's Introduction

Scanner: Efficient Video Analysis at Scale Build Status

To try out Scanner, check out our Quick start and browse our Wiki.

Scanner is like Spark for videos. It runs stateful functions across video frames using clusters of machines with CPUs and GPUs. For example, you could use Scanner to:

Click here to learn more about the design and usage of Scanner.

Scanner provides a Python API to organize your videos and run high-performance functions written in C++. For example, this program computes a histogram of colors for each frame in a set of videos on the GPU:

from scannerpy import Database, DeviceType, Job
from scannerpy.stdlib import parsers

with Database() as db:
    videos = db.ingest_video_collection('my_videos', ['vid0.mp4', 'vid1.mkv'])
    frame, frame_info = videos.as_op().all()
    histograms = db.ops.Histogram(frame = frame, frame_info = frame_info, device=DeviceType.GPU)
    job = Job(columns = [histograms], name = 'my_videos_hist')
    output = db.run(job)
    vid0_hists = output.tables(0).load(['histogram'], parsers.histograms)

Click here to see more code examples of using Scanner.

Scanner makes it easy to use existing computer vision and pixel processing tools. For example, Scanner supports deep neural networks with Caffe, image processing with OpenCV and Halide, and object tracking with Struck.

Scanner is an active research project, part of a collaboration between Carnegie Mellon and Stanford. Please contact Alex Poms and Will Crichton with questions.

Quick start

To quickly dive into Scanner, you can use one of our prebuilt Docker images. To run a GPU image, you must install and use nvidia-docker.

nvidia-docker run -d --name scanner -ti scannerresearch/scanner:gpu /bin/bash
nvidia-docker attach scanner

Note: if you don't have a GPU, then run docker instead of nvidia-docker and use scanner:cpu instead of scanner:gpu in the Docker image name.

Then inside your Docker container, run:

python examples/face_detection/face_detect.py

This runs a Scanner demo which detects faces in every frame of a short video from YouTube, creating a file example_faces.mp4. Type Ctrl-P + Ctrl-Q to detach from the container and then run:

nvidia-docker cp scanner:/opt/scanner/example_faces.mp4 .

Then you can view the generated video on your own machine. That's it!

Learning Scanner

To get started building your own applications with Scanner, check out:

scanner's People

Contributors

fpoms avatar willcrichton avatar satyaprateek1994 avatar jremmons avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.