https://github.com/christophreich1996/involution
PyTorch reimplementation of the paper "Involution: Inverting the Inherence of Convolution for Visual Recognition" (2D and 3D Involution) [CVPR 2021].
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Keywords
Repository
PyTorch reimplementation of the paper "Involution: Inverting the Inherence of Convolution for Visual Recognition" (2D and 3D Involution) [CVPR 2021].
Basic Info
- Host: GitHub
- Owner: ChristophReich1996
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://arxiv.org/pdf/2103.06255.pdf
- Size: 57.6 KB
Statistics
- Stars: 104
- Watchers: 6
- Forks: 20
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
Involution: Inverting the Inherence of Convolution for Visual Recognition
Unofficial PyTorch reimplementation of the paper Involution: Inverting the Inherence of Convolution for Visual Recognition by Duo Li, Jie Hu, Changhu Wang et al. published at CVPR 2021.
This repository includes a pure PyTorch implementation of a 2D and 3D involution.
Please note that the official implementation provides a more memory efficient CuPy implementation of the 2D involution. Additionally, shikishima-TasakiLab provides a fast and memory efficent CUDA implementation of the 2D Involution.
Installation
The 2D and 3D involution can be easily installed by using pip.
shell script
pip install git+https://github.com/ChristophReich1996/Involution
Example Usage
Additional examples, such as strided involutions or transposed convolution like involutions, can be found in the example.py file.
The 2D involution can be used as a nn.Module as follows:
````python
import torch
from involution import Involution2d
involution = Involution2d(inchannels=32, outchannels=64) output = involution(torch.rand(1, 32, 128, 128)) ````
The 2D involution takes the following parameters.
| Parameter | Description | Type | | ------------- | ------------- | ------------- | | inchannels | Number of input channels | int | | outchannels | Number of output channels | int | | sigmamapping | Non-linear mapping as introduced in the paper. If none BN + ReLU is utilized (default=None) | Optional[nn.Module] | | kernelsize | Kernel size to be used (default=(7, 7)) | Union[int, Tuple[int, int]] | | stride | Stride factor to be utilized (default=(1, 1)) | Union[int, Tuple[int, int]] | | groups | Number of groups to be employed (default=1) | int | | reduceratio | Reduce ration of involution channels (default=1) | int | | dilation | Dilation in unfold to be employed (default=(1, 1)) | Union[int, Tuple[int, int]] | | padding | Padding to be used in unfold operation (default=(3, 3)) | Union[int, Tuple[int, int]] | | bias | If true bias is utilized in each convolution layer (default=False) | bool | | forceshape_match | If true potential shape mismatch is solved by performing avg pool (default=False) | bool | | **kwargs | Unused additional key word arguments | Any |
The 3D involution can be used as a nn.Module as follows:
````python
import torch
from involution import Involution3d
involution = Involution3d(inchannels=8, outchannels=16) output = involution(torch.rand(1, 8, 32, 32, 32)) ````
The 3D involution takes the following parameters.
| Parameter | Description | Type | | ------------- | ------------- | ------------- | | inchannels | Number of input channels | int | | outchannels | Number of output channels | int | | sigmamapping | Non-linear mapping as introduced in the paper. If none BN + ReLU is utilized | Optional[nn.Module] | | kernelsize | Kernel size to be used (default=(7, 7, 7)) | Union[int, Tuple[int, int, int]] | | stride | Stride factor to be utilized (default=(1, 1, 1)) | Union[int, Tuple[int, int, int]] | | groups | Number of groups to be employed (default=1) | int | | reduceratio | Reduce ration of involution channels (default=1) | int | | dilation | Dilation in unfold to be employed (default=(1, 1, 1)) | Union[int, Tuple[int, int, int]] | | padding | Padding to be used in unfold operation (default=(3, 3, 3)) | Union[int, Tuple[int, int, int]] | | bias | If true bias is utilized in each convolution layer (default=False) | bool | | forceshape_match | If true potential shape mismatch is solved by performing avg pool (default=False) | bool | | **kwargs | Unused additional key word arguments | Any |
Reference
bibtex
@inproceedings{Li2021,
author = {Li, Duo and Hu, Jie and Wang, Changhu and Li, Xiangtai and She, Qi and Zhu, Lei and Zhang, Tong and Chen, Qifeng},
title = {Involution: Inverting the Inherence of Convolution for Visual Recognition},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021}
}
Owner
- Name: Christoph Reich
- Login: ChristophReich1996
- Kind: user
- Location: Germany
- Company: Technical University of Munich
- Website: christophreich1996.github.io
- Twitter: ChristophR1996
- Repositories: 41
- Profile: https://github.com/ChristophReich1996
ELLIS Ph.D. Student @ Technical University of Munich, Technische Universität Darmstadt & University of Oxford | Prev. NEC Labs