Skip to main content

Involution Operation - Pytorch

Project description

involution_pytorch

Unofficial PyTorch implementation of "Involution: Inverting the Inherence of Convolution for Visual Recognition" by Li et al. presented at CVPR 2021.


[abs, pdf, Yannic's Video]

Installation

You can install involution_pytorch via pip:

pip install involution_pytorch

Usage

You can use the Inv2d layer as you would with any PyTorch layer:

import torch
from involution_pytorch import Inv2d

inv = Inv2d(
    channels=16,
    kernel_size=3,
    stride=1
)

x = torch.rand(1, 16, 32, 32)
y = inv(x) # [1, 16, 32, 32]

The paper talks about using Self-Attention for the dynamic kernel generation function. I'll try implementing it later if time permits.

Contributing

If I've made any errors anywhere in the implementation, please do let me know by raising an issue. If there's any cool addition you want to introduce, all PRs appreciated!

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

involution_pytorch-0.0.2.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

involution_pytorch-0.0.2.2-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page