Shortcuts

mmcls.models

models 包中包含了若干子包,分别对应神经网络中不同的组件。

  • classifiers:定义完整分类模型的顶级模块。

  • backbones:用于特征提取的主干网络结构,如 ResNet、MobileNet。

  • necks:位于主干网络和头部网络之间的过渡层,如 GlobalAveragePooling。

  • heads:用于特定任务的头部网络。在 MMClassification 中,我们提供了若干用于分类任务的头部网络。

  • losses:损失函数

  • utils:一些辅助函数,或是在多个网络中出现的公共模块。

Build Functions

build_classifier

Build classifier.

build_backbone

Build backbone.

build_neck

Build neck.

build_head

Build head.

build_loss

Build loss.

Classifiers

BaseClassifier

Base class for classifiers.

ImageClassifier

Image classifiers for supervised classification task.

TimmClassifier

Image classifiers for pytorch-image-models (timm) model.

HuggingFaceClassifier

Image classifiers for HuggingFace model.

Backbones

AlexNet

AlexNet backbone.

BEiT

Backbone for BEiT.

CSPDarkNet

CSP-Darknet backbone used in YOLOv4.

CSPNet

The abstract CSP Network class.

CSPResNeXt

CSP-ResNeXt backbone.

CSPResNet

CSP-ResNet backbone.

Conformer

Conformer backbone.

ConvMixer

ConvMixer.

ConvNeXt

ConvNeXt v1&v2 backbone.

DaViT

DaViT.

DeiT3

DeiT3 backbone.

DenseNet

DenseNet.

DistilledVisionTransformer

Distilled Vision Transformer.

EdgeNeXt

EdgeNeXt.

EfficientFormer

EfficientFormer.

EfficientNet

EfficientNet backbone.

EfficientNetV2

EfficientNetV2 backbone.

HRNet

HRNet backbone.

HorNet

HorNet backbone.

InceptionV3

Inception V3 backbone.

LeNet5

LeNet5 backbone.

LeViT

LeViT backbone.

MViT

Multi-scale ViT v2.

MlpMixer

Mlp-Mixer backbone.

MobileNetV2

MobileNetV2 backbone.

MobileNetV3

MobileNetV3 backbone.

MobileOne

MobileOne backbone.

MobileViT

MobileViT backbone.

PCPVT

The backbone of Twins-PCPVT.

PoolFormer

PoolFormer.

PyramidVig

Pyramid Vision GNN backbone.

RegNet

RegNet backbone.

RepLKNet

RepLKNet backbone.

RepMLPNet

RepMLPNet backbone.

RepVGG

RepVGG backbone.

Res2Net

Res2Net backbone.

ResNeSt

ResNeSt backbone.

ResNeXt

ResNeXt backbone.

ResNet

ResNet backbone.

ResNetV1c

ResNetV1c backbone.

ResNetV1d

ResNetV1d backbone.

ResNet_CIFAR

ResNet backbone for CIFAR.

RevVisionTransformer

Reversible Vision Transformer.

SEResNeXt

SEResNeXt backbone.

SEResNet

SEResNet backbone.

SVT

The backbone of Twins-SVT.

ShuffleNetV1

ShuffleNetV1 backbone.

ShuffleNetV2

ShuffleNetV2 backbone.

SwinTransformer

Swin Transformer.

SwinTransformerV2

Swin Transformer V2.

T2T_ViT

Tokens-to-Token Vision Transformer (T2T-ViT)

TIMMBackbone

Wrapper to use backbones from timm library.

TNT

Transformer in Transformer.

VAN

Visual Attention Network.

VGG

VGG backbone.

Vig

Vision GNN backbone.

VisionTransformer

Vision Transformer.

XCiT

XCiT backbone.

Necks

GlobalAveragePooling

Global Average Pooling neck.

GeneralizedMeanPooling

Generalized Mean Pooling neck.

HRFuseScales

Fuse feature map of multiple scales in HRNet.

Heads

ClsHead

Classification head.

LinearClsHead

Linear classifier head.

StackedLinearClsHead

Classifier head with several hidden fc layer and a output fc layer.

VisionTransformerClsHead

Vision Transformer classifier head.

EfficientFormerClsHead

EfficientFormer classifier head.

DeiTClsHead

Distilled Vision Transformer classifier head.

ConformerHead

Linear classifier head.

ArcFaceClsHead

ArcFace classifier head.

MultiLabelClsHead

Classification head for multilabel task.

MultiLabelLinearClsHead

Linear classification head for multilabel task.

CSRAClsHead

Class-specific residual attention classifier head.

Losses

CrossEntropyLoss

Cross entropy loss.

LabelSmoothLoss

Initializer for the label smoothed cross entropy loss.

FocalLoss

Focal loss.

AsymmetricLoss

asymmetric loss.

SeesawLoss

Implementation of seesaw loss.

models.utils

This package includes some helper functions and common components used in various networks.

Common Components

InvertedResidual

Inverted Residual Block.

SELayer

Squeeze-and-Excitation Module.

WindowMSA

Window based multi-head self-attention (W-MSA) module with relative position bias.

WindowMSAV2

Window based multi-head self-attention (W-MSA) module with relative position bias.

ShiftWindowMSA

Shift Window Multihead Self-Attention Module.

MultiheadAttention

Multi-head Attention Module.

ConditionalPositionEncoding

The Conditional Position Encoding (CPE) module.

PatchEmbed

Image to Patch Embedding.

PatchMerging

Merge patch feature map.

HybridEmbed

CNN Feature Map Embedding.

LayerScale

LayerScale layer.

Helper Functions

channel_shuffle

Channel Shuffle operation.

make_divisible

Make divisible function.

resize_pos_embed

Resize pos_embed weights.

resize_relative_position_bias_table

Resize relative position bias table.

to_ntuple

A to_tuple function generator.

is_tracing

Determine whether the model is called during the tracing of code with torch.jit.trace.

Read the Docs v: mmcls-1.x
Versions
latest
stable
mmcls-1.x
mmcls-0.x
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.