https://github.com/szagoruyko/torch-opencv-demos
Torch7+OpenCV+ConvNets
https://github.com/szagoruyko/torch-opencv-demos
Last synced: 5 months ago
JSON representation
Torch7+OpenCV+ConvNets
- Host: GitHub
- URL: https://github.com/szagoruyko/torch-opencv-demos
- Owner: szagoruyko
- Created: 2016-01-13T11:30:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-25T04:32:50.000Z (about 7 years ago)
- Last Synced: 2025-01-01T18:35:05.051Z (5 months ago)
- Language: Lua
- Size: 1.7 MB
- Stars: 167
- Watchers: 17
- Forks: 56
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](https://github.com/riomus/torch-opencv-demos-docker) to make installation & experiments easier.
Otherwise...
Quick install on OS X:
```bash
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
* https://github.com/VisionLabs/torch-opencv
* https://github.com/szagoruyko/loadcaffe# 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:

# 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:

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:

# Realtime stylization with texture networks
Check https://github.com/DmitryUlyanov/texture_nets

# Credits
2016 Sergey Zagoruyko and Egor Burkov
Thanks to VisionLabs for putting up https://github.com/VisionLabs/torch-opencv bindings!