Code Monkey home page Code Monkey logo

carafe_cuda's Introduction

CARAFE_CUDA

This repo is a PyTorch cuda extension of the paper "CARAFE: Content-Aware ReAssembly of FEatures". It can replace the upsamling layer in the networks and is easy to be integrated into mmdetection.

Comparison with plain PyTorch

CARAFE can be implemented in plain PyTorch code by torch.nn.functional.unfold. However, the unfold function reassembles the features within a local region to generate a large feature map, which causes memory problem and is slow when the input is large.

CARAFE cuda extension can solve the memory problem and is ~10x faster than the code in plain PyTorch. More details can be referred to test.py.

How To Use

  • Keep the environment to be consistent with mmdetection.
  • Build
cd carafe_layer/
python setup.py build_ext --inplace
  • Test
python test.py

Results

We replace the upsampling layers with carafe_module in Mask R-CNN. The results with ResNet-50 are list as follows:

Method Orig-paper(box AP / mask AP) This-repo(box AP / mask AP)
Baseline 37.4/34.2 37.3/34.2
FPN w/ CARAFE 38.6/35.2 37.9/34.6
FPN + M.H w/ CARAFE 38.6/35.7 -/-

NOTE: M.H represents Mask Head in Mask R-CNN.

More results will be added.

carafe_cuda's People

Contributors

chensnathan avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

templeblock

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.