All Projects → Banus → caffe-demo

Banus / caffe-demo

Licence: other
Collection of deep learning demos based on neworks from the Caffe Zoo

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to caffe-demo

facial-landmarks
Facial landmarks detection with OpenCV, Dlib, DNN
Stars: ✭ 25 (+66.67%)
Mutual labels:  caffe
nettutorial
Deep learning tutorial
Stars: ✭ 27 (+80%)
Mutual labels:  caffe
XLearning-GPU
qihoo360 xlearning with GPU support; AI on Hadoop
Stars: ✭ 22 (+46.67%)
Mutual labels:  caffe
How to write cuda extensions in pytorch
How to write cuda kernels or c functions in pytorch, especially for former caffe users.
Stars: ✭ 51 (+240%)
Mutual labels:  caffe
caffe
This fork of BVLC/Caffe is dedicated to supporting Cambricon deep learning processor and improving performance of this deep learning framework when running on Machine Learning Unit(MLU).
Stars: ✭ 40 (+166.67%)
Mutual labels:  caffe
vqa-soft
Accompanying code for "A Simple Loss Function for Improving the Convergence and Accuracy of Visual Question Answering Models" CVPR 2017 VQA workshop paper.
Stars: ✭ 14 (-6.67%)
Mutual labels:  caffe
DLInfBench
CNN model inference benchmarks for some popular deep learning frameworks
Stars: ✭ 51 (+240%)
Mutual labels:  caffe
Face-Attributes-MultiTask-Classification
Use Cafffe to do Face Attributes MultiTask Classification based on CelebA data sets
Stars: ✭ 32 (+113.33%)
Mutual labels:  caffe
caffe-mobilenet-v3
Caffe Implementation of MobileNets V3
Stars: ✭ 127 (+746.67%)
Mutual labels:  caffe
caffe-yolo-9000
caffe-yolo-9000
Stars: ✭ 49 (+226.67%)
Mutual labels:  caffe
R2CNN
caffe re-implementation of R2CNN: Rotational Region CNN for Orientation Robust Scene Text Detection
Stars: ✭ 80 (+433.33%)
Mutual labels:  caffe
dd performances
DeepDetect performance sheet
Stars: ✭ 92 (+513.33%)
Mutual labels:  caffe
SSD Tracker
Counting people, dog and bicycle using SSD detection and tracking.
Stars: ✭ 17 (+13.33%)
Mutual labels:  caffe
ddrl
Deep Developmental Reinforcement Learning
Stars: ✭ 27 (+80%)
Mutual labels:  caffe
FDCNN
The implementation of FDCNN in paper - A Feature Difference Convolutional Neural Network-Based Change Detection Method
Stars: ✭ 54 (+260%)
Mutual labels:  caffe
caffe
Caffe: a Fast framework for deep learning. Custom version with built-in sparse inputs, segmentation, object detection, class weights, and custom layers
Stars: ✭ 36 (+140%)
Mutual labels:  caffe
TensorRT-LPR
车牌识别,基于HyperLPR实现,修改模型调用方法,使用caffe+tensorRT实现GPU加速,修改了车牌检测模型
Stars: ✭ 14 (-6.67%)
Mutual labels:  caffe
all-classifiers-2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 24 (+60%)
Mutual labels:  caffe
faster-rcnn-pedestrian-detection
Faster R-CNN for pedestrian detection
Stars: ✭ 31 (+106.67%)
Mutual labels:  caffe
Faster rcnn Cplusplus vs2013
faster-rcnn_VS2013with C++
Stars: ✭ 77 (+413.33%)
Mutual labels:  caffe

Python27 Python35 License

Caffe demo

This is a showcase of a small collection of neural networks implemented in Caffe, in order to evaluate their speed and accuracy on videos and images. A webcam interface is also available for live demos.

Classification interface

Demo interface. Image classification with SqueezeNet. Jaguar image by CaptainGiraffehands on Imgur.

Quick start

Download all the models:

cd models && ./download_models.sh all
cd ..

Try the classification interface with SqueezeNet [1]:

python deep_classification.py images/jaguar.jpg squeezenet

Try classification on webcam with GoogleNet:

python deep_classification.py webcam googlenet

Try the detection interface (CoCo classes) with the Yolo-tiny model:

python deep_classification.py images/giraffe.jpg tiny_yolo

And the detection interface with Pascal VOC classes:

python deep_classification.py images/dog.jpg tiny_yolo_voc
Detection interface

Detection interface. Object detection with YOLO-tiny. Image from Darknet by Joseph Chet Redmon.

Installation

To run the demos, you need to compile the toolbox Caffe with Python support; follow the instructions on the BVLC website. You both Python 2.7 and Python 3.5 distributions are supported.

You need also to install the Python interfaces for OpenCV; on Ubuntu:

sudo apt-get install python-opencv

The script searches the current location of the Caffe toolbox in the environmental variable CAFFE_ROOT. Set it to your Caffe installation, e.g:

export CAFFET_ROOT=${HOME}/caffe

You can download automatically all the networks supported by the demo running the following script (beware: it will download around 500 MB):

cd models && ./download_models.sh all

You can also download only the models you plan to use by passing them as parameters, e.g.

./download_models.sh caffenet squeezenet

YOLO models cannot be automatically downloaded from Google Drive and thus you have to download them manually in the models/yolo path. The links to the network weights in Caffe format are here:

Windows

You can run the demos in Windows by installing one of the Caffe for Windows pre-built binaries.

To install the script dependences, such as OpenCV, [Anaconda](https://conda.io/miniconda.html) is suggested. If you use Python 3, Caffe currently supports only the version 3.5, so you may have to create a virtual environment and activate it. Type in the command console (not Powershell as it has issues with Anaconda environments) if you are using Python 3:

    conda create -n caffe python=3.5
    activate caffe
    conda install scikit-image
conda install -c conda-forge py-opencv protobuf

An Anaconda environment file is avalable in caffe-env.yml. Create the environent with:

..code:: bash

conda create -n caffe -f caffe-env.yml

Set CAFFE_ROOT to point to the directory where you unpacked the Caffe distribution.

To download the models, use the Git bash shell:

cd models && sh download_models.sh all

The YOLO models will need to be downloaded manually.

Configuration file

The supported networks are specified in a network.ini configuration file in the same directory of the script. Each section of the configuration file specifies a supported network and you can add new sections or modify the existing ones to support your Caffe networks.

Each section has the form:

[network_name]
type = class
model = path_to_caffe_prototxt
weights = path_to_caffemodel
labels = path_to_list_of_dataset_labels
mean = mean_pixel
anchors = list of floats

The parameter type specifies the kind of network to load; as for now, the supported types are:

  • class: classification network with a n-way softmax at the last layer named prob
  • class_yolo: classification network from Darknet, with different pixel scaling and center crop
  • yolo_detect: YOLO detection network [2] where the last layer specifies at once detected classes, regressed bounding boxes and box confidence

The parameters model and weights point to the Caffe files required to load the network structure (.prototxt) and weights (.caffemodel). All the paths are relative to the configuration file.

The labels parameter points to a file with the name of the recognized classes in the order expected by the model. Currently are available the classes for the ImageNet, Places250, PascalVOC and MSCoCo datasets.

The optional mean parameter specifies the mean pixel value for the dataset as a triple of byte values in BGR format. If the mean is not available, the mean of the input image is used instead.

The optional anchors parameter specifies the bounding box biases in Darknet v2 detection networks and it has to be manuall copied from the corresponding .cfg file.

CPU mode: an additional parameter device in the DEFAULT section specifies if the CPU or the GPU (default) should be used for the model. You can override the parameter for a specific network by specifying a different device in its section.

References

[1] Iandola, F. N., Moskewicz, M. W., Ashraf, et al. (2016). SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <1MB model size. Arxiv.

[2] Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2015). You Only Look Once: Unified, Real-Time Object Detection. Arxiv.

License

The code is released under the BDS 2-clause license, except for the yolo_detector module which under the Darknet license (free for non-commercial use).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].