Git Product home page Git Product logo

deformable-kernels's Introduction

Deformable Kernels [ICLR 2020] [Website]

Deformable Kernels: Adapting Effective Receptive Fields for Object Deformation
Hang Gao*, Xizhou Zhu*, Steve Lin, Jifeng Dai.
In ICLR, 2020.

This repository contains official implementation of deformable kernels.

Table of contents

  1. Customized operators for deformable kernels, along with its variants.
  2. Instructions to use our operators.
  3. Results on ImageNet & COCO benchmarks, with pretrained models for reproduction.
  4. Training and evaluation code.

(0) Getting started

PyTorch

  • Get CUDA 10.1 installed on your machine.
  • Install PyTorch (pytorch.org).
  • conda env create -f environment.yml.

Apex

  • Install Apex from its official repo. This will require CUDA 10.1 to work with the latest pytorch version (which is pytorch=1.3.1 as being tested against). It is used for fast mix-precision inference and should work out of the box.

Compile our operators

# assume at project root
(
cd deformable_kernels/ops/deform_kernel;
pip install -e .;
)

(1) Customized operators

This repo includes all deformable kernel variants described in our paper, namely:

  • Global Deformable Kernels;
  • Local Deformable Kernels;
  • Local Deformable Kernels integrating with Deformable Convolutions;

Instead of learning offsets on image space, we propose to deform and resample on kernel space. This enables powerful dynamic inference capacity. For more technical details, please refer to their definitions.

We also provide implementations on our rivalries, namely:

Please refer to their module definitions under deformable_kernels/modules folder.

(2) Quickstart

The following snippet constructs the deformable kernels we used for our experiments

from deformable_kernels.modules import (
    GlobalDeformKernel2d,
    DeformKernel2d,
    DeformKernelConv2d,
)

# global DK with scope size 2, kernel size 1, stride 1, padding 0, depthwise convolution.
gdk = GlobalDeformKernel2d((2, 2), [inplanes], [inplanes], groups=[inplanes])
# (local) DK with scope size 4, kernel size 3, stride 1, padding 1, depthwise convolution.
dk = DeformKernel2d((4, 4), [inplanes], [inplanes], 3, 1, 1, groups=[inplanes])
# (local) DK integrating with dcn, with kernel & image offsets separately learnt.
dkc = DeformKernelConv2d((4, 4), [inplanes], [inplanes], 3, 1, 1, groups=[inplanes]).

Note that all of our customized operators only support depthwise convolutions now, mainly because that efficiently resampling kernels at runtime is extremely slow if we orthogonally compute over each channel. We are trying to loose this requirement by iterating our CUDA implementation. Any contribuitions are welcome!

(3) Results & pretrained models

Under construction.

(4) Training & evaluation code

Under construction.

(A) License

This project is released under the MIT license.

(B) Citation & Contact

If you find this repo useful for your research, please consider citing this bibtex:

@article{gao2019deformable,
  title={Deformable Kernels: Adapting Effective Receptive Fields for Object Deformation},
  author={Gao, Hang and Zhu, Xizhou and Lin, Steve and Dai, Jifeng},
  journal={arXiv preprint arXiv:1910.02940},
  year={2019}
}

Please contact Hang Gao <hangg AT eecs DOT berkeley DOT com> and Xizhou Zhu <ezra0408 AT mail.ustc DOT edu DOT cn> with any comments or feedback.

deformable-kernels's People

Contributors

hangg7 avatar

Stargazers

Owen718 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.