lbourdois's picture
Upload 174 files
94e735e verified
|
raw
history blame
1.36 kB

ο»ΏMany cutting-edge computer vision models consist of multiple stages:
➰ backbone extracts the features,
➰ neck refines the features,
➰ head makes the detection for the task.
Implementing this is cumbersome, so πŸ€— transformers has an API for this: Backbone!

image_1

Let's see an example of such model. Assuming we would like to initialize a multi-stage instance segmentation model with ResNet backbone and MaskFormer neck and a head, you can use the backbone API like following (left comments for clarity) πŸ‘‡

image_2

One can also use a backbone just to get features from any stage. You can initialize any backbone with AutoBackbone class. See below how to initialize a backbone and getting the feature maps at any stage πŸ‘‡

image_3

Backbone API also supports any timm backbone of your choice! Check out a variation of timm backbones here.

image_4

Leaving some links πŸ”—:
πŸ“– I've created a notebook for you to play with it
πŸ“’ Backbone API docs πŸ““ AutoBackbone docs πŸ’œ
(all written with love by me!)

Orignial tweet (January 23, 2024)