#483 · Primary category: Computer Vision

bottleneck-transformer-pytorch

artificial-intelligence attention-mechanism deep-learning image-classification transformers vision

Implementation of Bottleneck Transformer in Pytorch

Project last updated:09/20/21

GitHub Stars

677

Forks

81

Contributors

2

License

MIT

Why we included this project

This is a compact PyTorch version of the Bottleneck Transformer (BoTNet) from the CVPR 2021 paper, and it does one thing well: it gives you a BottleStack module you can splice into a torchvision ResNet with a few lines of model surgery to get the BotNet classifier. The code is short and readable, so it works both as a way to see how relative positional embeddings and multi-head attention fit into a convolutional feature map, and as a base for your own image classification experiments. Because it's a research reference rather than a maintained training pipeline, expect to adapt it rather than run it out of the box. If you're comparing hybrid convolution-attention backbones against a plain ResNet, this is a convenient starting point.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category