diff --git a/docs/source/en/main_classes/backbones.md b/docs/source/en/main_classes/backbones.md index 9fe5fe097a7b75..efea7eb32a84c8 100644 --- a/docs/source/en/main_classes/backbones.md +++ b/docs/source/en/main_classes/backbones.md @@ -18,8 +18,8 @@ rendered properly in your Markdown viewer. 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: -* [`~utils.backbone_utils.BackboneMixin`] enables initializing a backbone from Transformers or [timm](https://hf.co/docs/timm/index) and includes functions for returning the output features and indices. -* [`~utils.backbone_utils.BackboneConfigMixin`] sets the output features and indices of the backbone configuration. +* [`~utils.BackboneMixin`] enables initializing a backbone from Transformers or [timm](https://hf.co/docs/timm/index) and includes functions for returning the output features and indices. +* [`~utils.BackboneConfigMixin`] sets the output features and indices of the backbone configuration. [timm](https://hf.co/docs/timm/index) models are loaded with the [`TimmBackbone`] and [`TimmBackboneConfig`] classes. @@ -45,11 +45,11 @@ Backbones are supported for the following models: ## BackboneMixin -[[autodoc]] utils.backbone_utils.BackboneMixin +[[autodoc]] utils.BackboneMixin ## BackboneConfigMixin -[[autodoc]] utils.backbone_utils.BackboneConfigMixin +[[autodoc]] utils.BackboneConfigMixin ## TimmBackbone diff --git a/src/transformers/utils/__init__.py b/src/transformers/utils/__init__.py index 4f69b629b22df0..3a3c65a3b7d670 100644 --- a/src/transformers/utils/__init__.py +++ b/src/transformers/utils/__init__.py @@ -20,6 +20,7 @@ from packaging import version from .. import __version__ +from .backbone_utils import BackboneConfigMixin, BackboneMixin from .constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD from .doc import ( add_code_sample_docstrings,