Skip to content

vasim-akram/DeepVideoAnalytics

 
 

Repository files navigation

#Deep Video Analytics • Build Status Banner

Deep Video Analytics provides a platform for indexing and extracting information from videos and images. Deep learning detection and recognition algorithms are used for indexing individual frames / images along with detected objects. The goal of Deep Video analytics is to become a quickly customizable platform for developing visual & video analytics applications, while benefiting from seamless integration with state or the art models released by the vision research community.

Self-promotion: If you are interested in Healthcare & Machine Learning please take a look at my another Open Source project Computational Healthcare

Features

  • Visual Search using Nearest Neighbors algorithm as a primary interface
  • Upload videos, multiple images (zip file with folder names as labels)
  • Provide Youtube url to be automatically processed/downloaded by youtube-dl
  • Metadata stored in Postgres
  • Operations (Querying, Frame extraction & Indexing) performed using celery tasks and RabbitMQ
  • Separate queues and workers for selection of machines with different specifications (GPU vs RAM)
  • Videos, frames, indexes, numpy vectors stored in media directory, served through nginx
  • Explore data, manually run code & tasks without UI via a jupyter notebook explore.ipynb
  • Some documentation on design decision, architecture and deployment.

Models included out of the box

We take significant efforts to ensure that following models (code+weights included) work without having to write any code.

Planned algorithms & models

  1. Text detection models
  2. Soundnet (requires extracting mp3 audio)
  3. Open Images dataset pretrained inception v3
  4. Mapnet (requires converting models from Marvin)
  5. Keras-js which uses Keras inception for client side indexing

To Do

Please take a look at this board for planned future tasks

Installation

Pre-built docker images for both CPU & GPU versions are available on Docker Hub.

Machines without an Nvidia GPU

Deep Video analytics is implemented using Docker and works on Mac, Windows and Linux.

git clone https://github.com/AKSHAYUBHAT/DeepVideoAnalytics 
cd DeepVideoAnalytics/docker && docker-compose up 

Machines with Nvidia GPU

You need to have latest version of Docker and nvidia-docker installed. The GPU Dockerfile is slightly different from the CPU version dockerfile.

pip install --upgrade nvidia-docker-compose
git clone https://github.com/AKSHAYUBHAT/DeepVideoAnalytics 
cd DeepVideoAnalytics/docker_GPU && ./rebuild.sh 
nvidia-docker-compose up 

Multiple machines

Its possible to deploy Deep Video Analytics on multiple machines. Configuring Postgres and RabbitMQ is straightforward. The main issues is correctly mounting the shared media folder (ideally a mounted EFS or NFS). Please read this regarding trade offs.

Amazon P2 instance

We provide an AMI with all dependencies such as docker & nvidia drivers pre-installed. To use it start a P2.xlarge instance with ami-b3cc1fa5 (N. Virginia) and ports 8000, 6006, 8888 open (preferably to only your IP). Run following commands after logging into the machine via SSH.

cd deepvideoanalytics && git pull 
cd docker_GPU && ./rebuild.sh && nvidia-docker-compose up 

You can optionally specify "-d" at the end to detach it, but for the very first time its useful to read how each container is started. After approximately 5 ~ 1 minutes the user interface will appear on port 8000 of the instance ip. The Process used for AMI creation is here

Security warning: The current GPU container uses nginx <-> uwsgi <-> django setup to ensure smooth playback of videos. However it runs nginix as root (though within the container). Considering that you can now modify AWS Security rules on-the-fly, I highly recommend allowing inbound traffic only from your own IP address.)

Options

Following options can be specified in docker-compose.yml, or your environment to selectively enable/disable algorithms.

  • ALEX_ENABLE=1 (to use Alexnet with PyTorch. Otherwise disabled by default)
  • YOLO_ENABLE=1 (to use YOLO 9000. Otherwise disabled by default)
  • SCENEDETECT_DISABLE=1 (to disable scene detection, Otherwise enabled by default)

Architecture

Architecture

User Interface

Search

UI Screenshot

Past queries

UI Screenshot

Video list / detail

UI Screenshot UI Screenshot

Frame detail

UI Screenshot

Libraries & Code used

References

  1. Schroff, Florian, Dmitry Kalenichenko, and James Philbin. "Facenet: A unified embedding for face recognition and clustering." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015.
  2. Szegedy, Christian, et al. "Going deeper with convolutions." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015.
  3. Zhang, Kaipeng, et al. "Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks." IEEE Signal Processing Letters 23.10 (2016): 1499-1503.
  4. Liu, Wei, et al. "SSD: Single shot multibox detector." European Conference on Computer Vision. Springer International Publishing, 2016.
  5. Redmon, Joseph, et al. "You only look once: Unified, real-time object detection." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2016.
  6. Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E. Hinton. "Imagenet classification with deep convolutional neural networks." Advances in neural information processing systems. 2012.
  7. Johnson, Jeff, Matthijs Douze, and Hervé Jégou. "Billion-scale similarity search with GPUs." arXiv preprint arXiv:1702.08734 (2017).

Citation

Citation for Deep Video Analytics coming soon.

Copyright

Copyright 2016-2017, Akshay Bhat, Cornell University, All rights reserved.

About

A highly configurable visual search & analytics platform for images and videos.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 40.1%
  • C++ 30.1%
  • HTML 13.0%
  • C 5.6%
  • Jupyter Notebook 4.0%
  • Cuda 4.0%
  • Other 3.2%