e06fe8e8c6
Secret Leaks / trufflehog (push) Failing after 1s
Build documentation / build (push) Failing after 1s
Build documentation / build_other_lang (push) Failing after 0s
CodeQL Security Analysis / CodeQL Analysis (push) Failing after 0s
PR CI / pr-ci (push) Failing after 1s
Slow tests on important models (on Push - A10) / Get all modified files (push) Failing after 1s
Slow tests on important models (on Push - A10) / Model CI (push) Has been skipped
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Has been cancelled
New model PR merged notification / Notify new model (push) Has been cancelled
Update Transformers metadata / build_and_package (push) Has been cancelled
2.2 KiB
2.2 KiB
Backbone
A backbone is a model used for feature extraction for higher level computer vision tasks such as object detection and image classification. Transformers provides an [AutoBackbone] class for initializing a Transformers backbone from pretrained model weights, and two utility classes:
- [
~backbone_utils.BackboneMixin] enables initializing a backbone from Transformers or timm and includes functions for returning the output features and indices. - [
~backbone_utils.BackboneConfigMixin] sets the output features and indices of the backbone configuration.
timm models are loaded with the [TimmBackbone] and [TimmBackboneConfig] classes.
Backbones are supported for the following models:
- BEiT
- BiT
- ConvNext
- ConvNextV2
- DiNAT
- DINOV2
- FocalNet
- MaskFormer
- NAT
- ResNet
- Swin Transformer
- Swin Transformer v2
- ViTDet
AutoBackbone
autodoc AutoBackbone
BackboneMixin
autodoc backbone_utils.BackboneMixin
BackboneConfigMixin
autodoc backbone_utils.BackboneConfigMixin
TimmBackbone
autodoc models.timm_backbone.TimmBackbone
TimmBackboneConfig
autodoc models.timm_backbone.TimmBackboneConfig