• Stars
    star
    167
  • Rank 226,635 (Top 5 %)
  • Language
    Lua
  • Created almost 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Torch7+OpenCV+ConvNets

Torch7-OpenCV demos

Real-time demos that use deep convolutional neural networks to classify and caption what they see in real-time from a webcam stream.

All demos use CPU, but it's trivial to fix them to work with CUDA or OpenCL.

There's a Docker image to make installation & experiments easier.

Otherwise...

Quick install on OS X:

brew instal opencv3 --with-contrib
OpenCV_DIR=/usr/local/Cellar/opencv3/3.1.0/share/OpenCV luarocks install cv
brew install protobuf
luarocks install loadcaffe

In Linux you have to build OpenCV 3 manually. Follow the instructions in

ImageNet classification

The demo simply takes a central crop from a webcam and uses a small ImageNet classification pretrained network to classify what it see on it. top-5 predicted classes are shown on top, the top one is the most probable.

Run as th demo.lua

Example:

sunglasses

Age&Gender prediction

This demo uses two networks described here http://www.openu.ac.il/home/hassner/projects/cnn_agegender/ to predict age and gender of the faces that it finds with a simple cascade detector.

Run as

th demo.lua video_source [path-to-'haarcascade_frontalface_default.xml']

Where video_source is camera or path to a video file, and the second argument is optional.

IMAGINE Lab gives an example:

age&gender

NeuralTalk2 demo

This demo uses NeuralTalk2 captioning code from Andrej Karpathy: https://github.com/karpathy/neuraltalk2

The code captions live webcam demo. Follow the installation instructions at https://github.com/karpathy/neuraltalk2 first and then run the demo as:

th videocaptioning.lua -gpuid -1 -model model_id1-501-1448236541_cpu.t7

Caption is displayed on top:

neuraltalk2

Realtime stylization with texture networks

Check https://github.com/DmitryUlyanov/texture_nets

screen shot 2016-04-25 at 00 08 15

Credits

2016 Sergey Zagoruyko and Egor Burkov

Thanks to VisionLabs for putting up https://github.com/VisionLabs/torch-opencv bindings!

More Repositories

1

pytorchviz

A small package to create visualizations of PyTorch execution graphs
Jupyter Notebook
3,180
star
2

attention-transfer

Improving Convolutional Networks via Attention Transfer (ICLR 2017)
Jupyter Notebook
1,439
star
3

wide-residual-networks

3.8% and 18.3% on CIFAR-10 and CIFAR-100
Lua
1,297
star
4

diracnets

Training Very Deep Neural Networks Without Skip-Connections
Jupyter Notebook
586
star
5

functional-zoo

PyTorch and Tensorflow functional model definitions
Jupyter Notebook
586
star
6

loadcaffe

Load Caffe networks in Torch7
Protocol Buffer
494
star
7

cvpr15deepcompare

Code and models for "Learning to Compare Image Patches via Convolutional Neural Networks"
C++
467
star
8

pyinn

CuPy fused PyTorch neural networks ops
Python
274
star
9

cifar.torch

92.45% on CIFAR-10 in Torch
Lua
174
star
10

binary-wide-resnet

PyTorch implementation of Wide Residual Networks with 1-bit weights by McDonnell (ICLR 2018)
Python
124
star
11

imagine-nn

IMAGINE torch neural network routines
Lua
109
star
12

torch-caffe-binding

Use Caffe in Torch7
C++
64
star
13

imagenet-validation.torch

Fast and easy testing of imagenet models
Lua
49
star
14

neural-style-autograd

autograd version of https://github.com/jcjohnson/neural-style
Lua
44
star
15

cunnproduction

easy embeddable Torch7 networks
C++
35
star
16

nnpack.torch

Torch FFI-bindings for NNPACK
Lua
30
star
17

iterm.torch

Display images directly in iTerm2
Lua
28
star
18

openai-gemm.pytorch

PyTorch bindings for openai-gemm
Python
20
star
19

fastrcnn-models.torch

Fast-RCNN models in Torch-7 format
18
star
20

cutorch-rtc

lua apply function for cutorch
Lua
17
star
21

idiap-tutorials

Jupyter Notebook
16
star
22

functional-style-transfer

minimal implementation of style transfer
Jupyter Notebook
10
star
23

nvrtc.torch

Torch7 bindings for CUDA NVRTC (runtime compilation) library
Lua
9
star
24

imi-demos

live convolutional neural networks demos
Python
9
star
25

cunn-rtc

Runtime compiled Torch cunn modules
Lua
8
star
26

clipp.torch

Torch interface to OpenCLIPP
C++
6
star
27

examples

Python
5
star
28

libclsvm

OpenCL optimized SVM library
C++
2
star
29

infimnist.torch

Torch7 InfiMNIST ffi binding
C
1
star