All Projects → unsky → Deformable Convnets Caffe

unsky / Deformable Convnets Caffe

Deformable Convolutional Networks on caffe

Projects that are alternatives of or similar to Deformable Convnets Caffe

Fundamentals Of Deep Learning For Computer Vision Nvidia
The repository includes Notebook files and documents of the course I completed in NVIDIA Deep Learning Institute. Feel free to acess and work with the Notebooks and other files.
Stars: ✭ 16 (-90.36%)
Mutual labels:  jupyter-notebook, caffe
Bottom Up Attention
Bottom-up attention model for image captioning and VQA, based on Faster R-CNN and Visual Genome
Stars: ✭ 989 (+495.78%)
Mutual labels:  jupyter-notebook, caffe
All Classifiers 2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 22 (-86.75%)
Mutual labels:  jupyter-notebook, caffe
Caffenet Benchmark
Evaluation of the CNN design choices performance on ImageNet-2012.
Stars: ✭ 700 (+321.69%)
Mutual labels:  jupyter-notebook, caffe
Sphereface
Implementation for <SphereFace: Deep Hypersphere Embedding for Face Recognition> in CVPR'17.
Stars: ✭ 1,483 (+793.37%)
Mutual labels:  jupyter-notebook, caffe
Keras realtime multi Person pose estimation
Keras version of Realtime Multi-Person Pose Estimation project
Stars: ✭ 728 (+338.55%)
Mutual labels:  jupyter-notebook, caffe
Picanet
Stars: ✭ 35 (-78.92%)
Mutual labels:  jupyter-notebook, caffe
Vpgnet
VPGNet: Vanishing Point Guided Network for Lane and Road Marking Detection and Recognition (ICCV 2017)
Stars: ✭ 382 (+130.12%)
Mutual labels:  jupyter-notebook, caffe
Facemaskdetection
开源人脸口罩检测模型和数据 Detect faces and determine whether people are wearing mask.
Stars: ✭ 1,677 (+910.24%)
Mutual labels:  jupyter-notebook, caffe
Keras Oneclassanomalydetection
[5 FPS - 150 FPS] Learning Deep Features for One-Class Classification (AnomalyDetection). Corresponds RaspberryPi3. Convert to Tensorflow, ONNX, Caffe, PyTorch. Implementation by Python + OpenVINO/Tensorflow Lite.
Stars: ✭ 102 (-38.55%)
Mutual labels:  jupyter-notebook, caffe
Realtime multi Person pose estimation
Code repo for realtime multi-person pose estimation in CVPR'17 (Oral)
Stars: ✭ 4,760 (+2767.47%)
Mutual labels:  jupyter-notebook, caffe
Sphereface Plus
SphereFace+ Implementation for <Learning towards Minimum Hyperspherical Energy> in NIPS'18.
Stars: ✭ 151 (-9.04%)
Mutual labels:  jupyter-notebook, caffe
Deep Learning Traffic Lights
Code and files of the deep learning model used to win the Nexar Traffic Light Recognition challenge
Stars: ✭ 457 (+175.3%)
Mutual labels:  jupyter-notebook, caffe
Face Mask Detection
Face Mask Detection system based on computer vision and deep learning using OpenCV and Tensorflow/Keras
Stars: ✭ 774 (+366.27%)
Mutual labels:  jupyter-notebook, caffe
Deepnetsforeo
Deep networks for Earth Observation
Stars: ✭ 393 (+136.75%)
Mutual labels:  jupyter-notebook, caffe
Teacher Student Training
This repository stores the files used for my summer internship's work on "teacher-student learning", an experimental method for training deep neural networks using a trained teacher model.
Stars: ✭ 34 (-79.52%)
Mutual labels:  jupyter-notebook, caffe
Textspotter
Stars: ✭ 323 (+94.58%)
Mutual labels:  jupyter-notebook, caffe
Learning
The data is the future of oil, digging the potential value of the data is very meaningful. This library records my road of machine learning study.
Stars: ✭ 330 (+98.8%)
Mutual labels:  jupyter-notebook, caffe
Training toolbox caffe
Training Toolbox for Caffe
Stars: ✭ 51 (-69.28%)
Mutual labels:  jupyter-notebook, caffe
Seqface
SeqFace : Making full use of sequence information for face recognition
Stars: ✭ 125 (-24.7%)
Mutual labels:  jupyter-notebook, caffe

Caffe implementation of Deformable Convolutional Networks

results:

faster rcnn(resnet50) result is implemented without OHEM and deformable roi pooling

train with pascal voc 2007 + 2012 test on 2007

[email protected] aeroplane bicycle bird boat bottle bus car cat chair cow
0.7811 0.7810 0.8560 0.7828 0.6910 0.5948 0.8430 0.8741 0.8878 0.6213 0.8347
diningtable dog horse motorbike person pottedplant sheep sofa train tv
0.7324 0.8695 0.8893 0.8507 0.7986 0.5226 0.7791 0.7933 0.8528 0.7668

Usage

Use modified caffe

The MNIST example is in caffe/defor/

Compile:

mkdir build cd build cmake ..  make  all

Train & test:

cd caffe/defor/
./train_lenet.sh

and the model is in caffe/defor/model_protxt/

use faster rcnn

download voc07,12 dataset ResNet50.caffemodel and rename to ResNet50.v2.caffemodel

cp ResNet50.v2.caffemodel data/pretrained_model/
  • OneDrive download: link

Train &test:

./experiments/scripts/faster_rcnn_end2end.sh  0 ResNet50  pascal_voc
./test.sh  0 ResNet50  pascal_voc

Use the codes in your caffe

All codes are in deformable_conv_cxx/

1. Add layer definition to caffe.proto:

optional DeformableConvolutionParameter deformable_convolution_param = 999;
  
message DeformableConvolutionParameter {
  optional uint32 num_output = 1; 
  optional bool bias_term = 2 [default = true]; 
  repeated uint32 pad = 3; // The padding size; defaults to 0
  repeated uint32 kernel_size = 4; // The kernel size
  repeated uint32 stride = 6; // The stride; defaults to 1
  repeated uint32 dilation = 18; // The dilation; defaults to 1
  optional uint32 pad_h = 9 [default = 0]; // The padding height (2D only)
  optional uint32 pad_w = 10 [default = 0]; // The padding width (2D only)
  optional uint32 kernel_h = 11; // The kernel height (2D only)
  optional uint32 kernel_w = 12; // The kernel width (2D only)
  optional uint32 stride_h = 13; // The stride height (2D only)
  optional uint32 stride_w = 14; // The stride width (2D only)
  optional uint32 group = 5 [default = 4]; 
  optional uint32 deformable_group = 25 [default = 4]; 
  optional FillerParameter weight_filler = 7; // The filler for the weight
  optional FillerParameter bias_filler = 8; // The filler for the bias
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 15 [default = DEFAULT];
  optional int32 axis = 16 [default = 1];
  optional bool force_nd_im2col = 17 [default = false];
}

you can read the template in deformable_conv_cxx/caffe.proto

2.Move codes to your caffe

move deformable_conv_layer.cpp and deformable_conv_layer.cu to yourcaffepath/src\caffe\layers\

move deformable_conv_layer.hpp to yourcaffepath/include\caffe\layers\

move deformable_conv_layer.hpp to yourcaffepath/include\caffe\layers\

move deformable_im2col.cu to yourcaffepath\src\caffe\util\

move deformable_im2col.hpp to yourcaffepath\include\caffe\util\

3.Compile in your caffe root path

mkdir build cd build  cmake ..   make  all

About the deformable conv layer

The params in DeformableConvolution:

bottom[0](data): (batch_size, channel, height, width)
bottom[1] (offset): (batch_size, deformable_group * kernel[0] * kernel[1]*2, height, width)

Define:

f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1

the output of the DeformableConvolution layer:

out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])

Offset layer:

layer {
  name: "offset"
  type: "Convolution"
  bottom: "pool1"
  top: "offset"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  convolution_param {
    num_output: 72
    kernel_size: 3
    stride: 1
    dilation: 2
    pad: 2
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }
  }
}

DeformableConvolution layer:

layer {
  name: "dec"
  type: "DeformableConvolution"
  bottom: "conv1"
  bottom: "offset"
  top: "dec"
  param {
    lr_mult: 1
  }
  param {
    lr_mult: 2
  }
  deformable_convolution_param {
    num_output: 512
    kernel_size: 3
    stride: 1
    pad: 2
    engine: 1
    dilation: 2
    deformable_group: 4
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }
  }
}

the prototxt model should like:

The following animation is generated by Felix Lau (with his tensorflow implementation):https://github.com/felixlaumon/deform-conv/

TODO List

  • [x] all tests passed
  • [x] evaluate performance on Regular MNIST
  • [x] evaluate object detection performance on voc

Deformable Convolutional Networks

Dai, Jifeng, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. 2017. “Deformable Convolutional Networks.” arXiv [cs.CV]. arXiv. http://arxiv.org/abs/1703.06211

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].