SYMBOL INDEX (831 symbols across 108 files) FILE: docs/conf.py function get_version (line 30) | def get_version(): class FakeSignature (line 130) | class FakeSignature: method __getattribute__ (line 131) | def __getattribute__(self, *args): function f (line 135) | def f(app, obj, bound_method): function setup (line 140) | def setup(app): FILE: examples/binary_segmentation_buildings.py class Dataset (line 102) | class Dataset(BaseDataset): method __init__ (line 119) | def __init__( method __getitem__ (line 139) | def __getitem__(self, i): method __len__ (line 189) | def __len__(self): class CamVidModel (line 194) | class CamVidModel(torch.nn.Module): method __init__ (line 212) | def __init__(self, arch, encoder_name, in_channels=3, out_classes=1, *... method forward (line 224) | def forward(self, image): function visualize (line 231) | def visualize(output_dir, image_filename, **images): function train_and_evaluate_one_epoch (line 247) | def train_and_evaluate_one_epoch( function train_model (line 286) | def train_model( function test_model (line 323) | def test_model(model, output_dir, test_dataloader, loss_fn, device): FILE: misc/generate_table.py function wrap_row (line 17) | def wrap_row(r): FILE: misc/generate_table_timm.py function check_features_and_reduction (line 5) | def check_features_and_reduction(name): function has_dilation_support (line 11) | def has_dilation_support(name): function valid_vit_encoder_for_dpt (line 20) | def valid_vit_encoder_for_dpt(name): function make_table (line 40) | def make_table(data): FILE: misc/generate_test_models.py function save_and_push (line 13) | def save_and_push(model, inputs, outputs, model_name, encoder_name): FILE: scripts/models-conversions/dpt-original-to-smp.py function get_transform (line 11) | def get_transform(): FILE: scripts/models-conversions/segformer-original-decoder-to-smp.py function convert_state_dict_to_smp (line 13) | def convert_state_dict_to_smp(state_dict: dict): function get_np_image (line 60) | def get_np_image(): function main (line 66) | def main(args): FILE: scripts/models-conversions/upernet-hf-to-smp.py function convert_old_keys_to_new_keys (line 120) | def convert_old_keys_to_new_keys(state_dict_keys: dict, keys_mapping: di... function group_qkv_layers (line 138) | def group_qkv_layers(state_dict: dict) -> dict: function convert_model (line 162) | def convert_model(model_name: str, push_to_hub: bool = False): FILE: segmentation_models_pytorch/__init__.py function create_model (line 43) | def create_model( FILE: segmentation_models_pytorch/base/heads.py class SegmentationHead (line 6) | class SegmentationHead(nn.Sequential): method __init__ (line 7) | def __init__( class ClassificationHead (line 22) | class ClassificationHead(nn.Sequential): method __init__ (line 23) | def __init__( FILE: segmentation_models_pytorch/base/hub_mixin.py function _format_parameters (line 52) | def _format_parameters(parameters: dict): class SMPHubMixin (line 63) | class SMPHubMixin(PyTorchModelHubMixin): method generate_model_card (line 64) | def generate_model_card(self, *args, **kwargs) -> ModelCard: method save_pretrained (line 96) | def save_pretrained( method config (line 119) | def config(self) -> dict: function from_pretrained (line 124) | def from_pretrained( function supports_config_loading (line 147) | def supports_config_loading(func): FILE: segmentation_models_pytorch/base/initialization.py function initialize_decoder (line 4) | def initialize_decoder(module): function initialize_head (line 23) | def initialize_head(module): FILE: segmentation_models_pytorch/base/model.py class SegmentationModel (line 12) | class SegmentationModel(torch.nn.Module, SMPHubMixin): method __new__ (line 23) | def __new__(cls: Type[T], *args, **kwargs) -> T: method __init__ (line 27) | def __init__(self): method initialize (line 31) | def initialize(self): method check_input_shape (line 37) | def check_input_shape(self, x): method forward (line 62) | def forward(self, x): method predict (line 82) | def predict(self, x): method load_state_dict (line 97) | def load_state_dict(self, state_dict, **kwargs): method train (line 145) | def train(self, mode: bool = True): method _set_encoder_trainable (line 175) | def _set_encoder_trainable(self, mode: bool): method freeze_encoder (line 187) | def freeze_encoder(self): method unfreeze_encoder (line 201) | def unfreeze_encoder(self): FILE: segmentation_models_pytorch/base/modules.py function get_norm_layer (line 12) | def get_norm_layer( class Conv2dReLU (line 89) | class Conv2dReLU(nn.Sequential): method __init__ (line 90) | def __init__( class SCSEModule (line 117) | class SCSEModule(nn.Module): method __init__ (line 118) | def __init__(self, in_channels, reduction=16): method forward (line 129) | def forward(self, x): class ArgMax (line 133) | class ArgMax(nn.Module): method __init__ (line 134) | def __init__(self, dim=None): method forward (line 138) | def forward(self, x): class Clamp (line 142) | class Clamp(nn.Module): method __init__ (line 143) | def __init__(self, min=0, max=1): method forward (line 147) | def forward(self, x): class Activation (line 151) | class Activation(nn.Module): method __init__ (line 152) | def __init__(self, name, **params): method forward (line 181) | def forward(self, x): class Attention (line 185) | class Attention(nn.Module): method __init__ (line 186) | def __init__(self, name, **params): method forward (line 196) | def forward(self, x): FILE: segmentation_models_pytorch/base/utils.py function is_torch_compiling (line 5) | def is_torch_compiling(): FILE: segmentation_models_pytorch/datasets/oxford_pet.py class OxfordPetDataset (line 11) | class OxfordPetDataset(torch.utils.data.Dataset): method __init__ (line 12) | def __init__(self, root, mode="train", transform=None): method __len__ (line 24) | def __len__(self): method __getitem__ (line 27) | def __getitem__(self, idx): method _preprocess_mask (line 44) | def _preprocess_mask(mask): method _read_split (line 50) | def _read_split(self): method download (line 63) | def download(root): class SimpleOxfordPetDataset (line 81) | class SimpleOxfordPetDataset(OxfordPetDataset): method __getitem__ (line 82) | def __getitem__(self, *args, **kwargs): class TqdmUpTo (line 104) | class TqdmUpTo(tqdm): method update_to (line 105) | def update_to(self, b=1, bsize=1, tsize=None): function download_url (line 111) | def download_url(url, filepath): function extract_archive (line 128) | def extract_archive(filepath): FILE: segmentation_models_pytorch/decoders/deeplabv3/decoder.py class DeepLabV3Decoder (line 43) | class DeepLabV3Decoder(nn.Module): method __init__ (line 44) | def __init__( method forward (line 64) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: class DeepLabV3PlusDecoder (line 73) | class DeepLabV3PlusDecoder(nn.Module): method __init__ (line 74) | def __init__( method forward (line 133) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: class ASPPConv (line 142) | class ASPPConv(nn.Sequential): method __init__ (line 143) | def __init__(self, in_channels: int, out_channels: int, dilation: int): class ASPPSeparableConv (line 158) | class ASPPSeparableConv(nn.Sequential): method __init__ (line 159) | def __init__(self, in_channels: int, out_channels: int, dilation: int): class ASPPPooling (line 174) | class ASPPPooling(nn.Sequential): method __init__ (line 175) | def __init__(self, in_channels: int, out_channels: int): method forward (line 183) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ASPP (line 190) | class ASPP(nn.Module): method __init__ (line 191) | def __init__( method forward (line 225) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SeparableConv2d (line 233) | class SeparableConv2d(nn.Sequential): method __init__ (line 234) | def __init__( FILE: segmentation_models_pytorch/decoders/deeplabv3/model.py class DeepLabV3 (line 16) | class DeepLabV3(SegmentationModel): method __init__ (line 59) | def __init__( method load_state_dict (line 125) | def load_state_dict(self, state_dict, *args, **kwargs): class DeepLabV3Plus (line 141) | class DeepLabV3Plus(SegmentationModel): method __init__ (line 185) | def __init__( FILE: segmentation_models_pytorch/decoders/dpt/decoder.py class ReadoutConcatBlock (line 7) | class ReadoutConcatBlock(nn.Module): method __init__ (line 16) | def __init__(self, embed_dim: int, has_prefix_tokens: bool): method forward (line 25) | def forward( class ReadoutAddBlock (line 49) | class ReadoutAddBlock(nn.Module): method forward (line 57) | def forward( class ReadoutIgnoreBlock (line 68) | class ReadoutIgnoreBlock(nn.Module): method forward (line 73) | def forward(self, features: torch.Tensor, *args, **kwargs) -> torch.Te... class ReassembleBlock (line 77) | class ReassembleBlock(nn.Module): method __init__ (line 83) | def __init__( method forward (line 124) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ResidualConvBlock (line 131) | class ResidualConvBlock(nn.Module): method __init__ (line 132) | def __init__(self, feature_dim: int): method forward (line 153) | def forward(self, x: torch.Tensor) -> torch.Tensor: class FusionBlock (line 172) | class FusionBlock(nn.Module): method __init__ (line 177) | def __init__(self, feature_dim: int): method forward (line 184) | def forward( class DPTDecoder (line 200) | class DPTDecoder(nn.Module): method __init__ (line 212) | def __init__( method forward (line 269) | def forward( class DPTSegmentationHead (line 288) | class DPTSegmentationHead(nn.Module): method __init__ (line 289) | def __init__( method forward (line 311) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/dpt/model.py class DPT (line 16) | class DPT(SegmentationModel): method __init__ (line 81) | def __init__( method forward (line 152) | def forward(self, x): FILE: segmentation_models_pytorch/decoders/fpn/decoder.py class Conv3x3GNReLU (line 8) | class Conv3x3GNReLU(nn.Module): method __init__ (line 9) | def __init__(self, in_channels: int, out_channels: int, upsample: bool... method forward (line 20) | def forward(self, x: torch.Tensor) -> torch.Tensor: class FPNBlock (line 27) | class FPNBlock(nn.Module): method __init__ (line 28) | def __init__( method forward (line 38) | def forward(self, x: torch.Tensor, skip: torch.Tensor) -> torch.Tensor: class SegmentationBlock (line 45) | class SegmentationBlock(nn.Module): method __init__ (line 46) | def __init__(self, in_channels: int, out_channels: int, n_upsamples: i... method forward (line 57) | def forward(self, x): class MergeBlock (line 61) | class MergeBlock(nn.Module): method __init__ (line 62) | def __init__(self, policy: Literal["add", "cat"]): method forward (line 70) | def forward(self, x: List[torch.Tensor]) -> torch.Tensor: class FPNDecoder (line 84) | class FPNDecoder(nn.Module): method __init__ (line 85) | def __init__( method forward (line 129) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/fpn/model.py class FPN (line 14) | class FPN(SegmentationModel): method __init__ (line 58) | def __init__( FILE: segmentation_models_pytorch/decoders/linknet/decoder.py class TransposeX2 (line 8) | class TransposeX2(nn.Sequential): method __init__ (line 9) | def __init__( class DecoderBlock (line 24) | class DecoderBlock(nn.Module): method __init__ (line 25) | def __init__( method forward (line 49) | def forward( class LinknetDecoder (line 58) | class LinknetDecoder(nn.Module): method __init__ (line 59) | def __init__( method forward (line 92) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/linknet/model.py class Linknet (line 15) | class Linknet(SegmentationModel): method __init__ (line 74) | def __init__( FILE: segmentation_models_pytorch/decoders/manet/decoder.py class PABBlock (line 10) | class PABBlock(nn.Module): method __init__ (line 11) | def __init__(self, in_channels: int, pab_channels: int = 64): method forward (line 23) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MFABBlock (line 46) | class MFABBlock(nn.Module): method __init__ (line 47) | def __init__( method forward (line 105) | def forward( class DecoderBlock (line 121) | class DecoderBlock(nn.Module): method __init__ (line 122) | def __init__( method forward (line 147) | def forward( class MAnetDecoder (line 158) | class MAnetDecoder(nn.Module): method __init__ (line 159) | def __init__( method forward (line 205) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/manet/model.py class MAnet (line 15) | class MAnet(SegmentationModel): method __init__ (line 79) | def __init__( FILE: segmentation_models_pytorch/decoders/pan/decoder.py class ConvBnRelu (line 9) | class ConvBnRelu(nn.Module): method __init__ (line 10) | def __init__( method forward (line 40) | def forward(self, x: torch.Tensor) -> torch.Tensor: class FPABlock (line 53) | class FPABlock(nn.Module): method __init__ (line 54) | def __init__( method forward (line 119) | def forward(self, x: torch.Tensor) -> torch.Tensor: class GAUBlock (line 166) | class GAUBlock(nn.Module): method __init__ (line 167) | def __init__( method forward (line 192) | def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: class PANDecoder (line 211) | class PANDecoder(nn.Module): method __init__ (line 212) | def __init__( method forward (line 253) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/pan/model.py class PAN (line 15) | class PAN(SegmentationModel): method __init__ (line 61) | def __init__( FILE: segmentation_models_pytorch/decoders/pspnet/decoder.py class PSPBlock (line 10) | class PSPBlock(nn.Module): method __init__ (line 11) | def __init__( method forward (line 32) | def forward(self, x: torch.Tensor) -> torch.Tensor: class PSPModule (line 51) | class PSPModule(nn.Module): method __init__ (line 52) | def __init__( method forward (line 72) | def forward(self, x): class PSPDecoder (line 78) | class PSPDecoder(nn.Module): method __init__ (line 79) | def __init__( method forward (line 103) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/pspnet/model.py class PSPNet (line 15) | class PSPNet(SegmentationModel): method __init__ (line 75) | def __init__( FILE: segmentation_models_pytorch/decoders/segformer/decoder.py class MLP (line 9) | class MLP(nn.Module): method __init__ (line 10) | def __init__(self, skip_channels: int, segmentation_channels: int): method forward (line 15) | def forward(self, x: torch.Tensor): class SegformerDecoder (line 23) | class SegformerDecoder(nn.Module): method __init__ (line 24) | def __init__( method forward (line 56) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/segformer/model.py class Segformer (line 14) | class Segformer(SegmentationModel): method __init__ (line 52) | def __init__( FILE: segmentation_models_pytorch/decoders/unet/decoder.py class UnetDecoderBlock (line 10) | class UnetDecoderBlock(nn.Module): method __init__ (line 13) | def __init__( method forward (line 43) | def forward( class UnetCenterBlock (line 64) | class UnetCenterBlock(nn.Sequential): method __init__ (line 67) | def __init__( class UnetDecoder (line 90) | class UnetDecoder(nn.Module): method __init__ (line 97) | def __init__( method forward (line 151) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/unet/model.py class Unet (line 15) | class Unet(SegmentationModel): method __init__ (line 108) | def __init__( FILE: segmentation_models_pytorch/decoders/unetplusplus/decoder.py class DecoderBlock (line 10) | class DecoderBlock(nn.Module): method __init__ (line 11) | def __init__( method forward (line 51) | def forward( class CenterBlock (line 67) | class CenterBlock(nn.Sequential): method __init__ (line 68) | def __init__( class UnetPlusPlusDecoder (line 91) | class UnetPlusPlusDecoder(nn.Module): method __init__ (line 92) | def __init__( method forward (line 157) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/unetplusplus/model.py class UnetPlusPlus (line 15) | class UnetPlusPlus(SegmentationModel): method __init__ (line 79) | def __init__( FILE: segmentation_models_pytorch/decoders/upernet/decoder.py class PSPModule (line 10) | class PSPModule(nn.Module): method __init__ (line 11) | def __init__( method forward (line 41) | def forward(self, feature: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 57) | class LayerNorm2d(nn.LayerNorm): method forward (line 58) | def forward(self, x: torch.Tensor) -> torch.Tensor: class FPNLateralBlock (line 67) | class FPNLateralBlock(nn.Module): method __init__ (line 68) | def __init__( method forward (line 82) | def forward( class UPerNetDecoder (line 97) | class UPerNetDecoder(nn.Module): method __init__ (line 98) | def __init__( method forward (line 163) | def forward(self, features: List[torch.Tensor]) -> torch.Tensor: FILE: segmentation_models_pytorch/decoders/upernet/model.py class UPerNet (line 14) | class UPerNet(SegmentationModel): method __init__ (line 69) | def __init__( FILE: segmentation_models_pytorch/encoders/__init__.py function is_equivalent_to_timm_universal (line 58) | def is_equivalent_to_timm_universal(name): function get_encoder (line 72) | def get_encoder(name, in_channels=3, depth=5, weights=None, output_strid... function get_encoder_names (line 164) | def get_encoder_names(): function get_preprocessing_params (line 168) | def get_preprocessing_params(encoder_name, pretrained="imagenet"): function get_preprocessing_fn (line 211) | def get_preprocessing_fn(encoder_name, pretrained="imagenet"): FILE: segmentation_models_pytorch/encoders/_base.py class EncoderMixin (line 7) | class EncoderMixin: method __init__ (line 17) | def __init__(self): method out_channels (line 23) | def out_channels(self): method output_stride (line 28) | def output_stride(self): method set_in_channels (line 31) | def set_in_channels(self, in_channels, pretrained=True): method get_stages (line 44) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method make_dilated (line 50) | def make_dilated(self, output_stride): FILE: segmentation_models_pytorch/encoders/_dpn.py class CatBnAct (line 17) | class CatBnAct(nn.Module): method __init__ (line 18) | def __init__(self, in_chs, activation_fn=nn.ReLU(inplace=True)): method forward (line 23) | def forward(self, x): class BnActConv2d (line 28) | class BnActConv2d(nn.Module): method __init__ (line 29) | def __init__( method forward (line 46) | def forward(self, x): class InputBlock (line 50) | class InputBlock(nn.Module): method __init__ (line 51) | def __init__( method forward (line 71) | def forward(self, x): class DualPathBlock (line 79) | class DualPathBlock(nn.Module): method __init__ (line 80) | def __init__( method forward (line 136) | def forward(self, x): class DPN (line 163) | class DPN(nn.Module): method __init__ (line 164) | def __init__( method logits (line 245) | def logits(self, features): method forward (line 256) | def forward(self, input): function pooling_factor (line 275) | def pooling_factor(pool_type="avg"): function adaptive_avgmax_pool2d (line 279) | def adaptive_avgmax_pool2d(x, pool_type="avg", padding=0, count_include_... class AdaptiveAvgMaxPool2d (line 320) | class AdaptiveAvgMaxPool2d(torch.nn.Module): method __init__ (line 323) | def __init__(self, output_size=1, pool_type="avg"): method forward (line 341) | def forward(self, x): method factor (line 352) | def factor(self): method __repr__ (line 355) | def __repr__(self): FILE: segmentation_models_pytorch/encoders/_efficientnet.py class MBConvBlock (line 56) | class MBConvBlock(nn.Module): method __init__ (line 70) | def __init__( method forward (line 157) | def forward(self, inputs: torch.Tensor, drop_connect_rate: Optional[fl... class EfficientNet (line 200) | class EfficientNet(nn.Module): method __init__ (line 219) | def __init__(self, blocks_args: List[BlockArgs], global_params: Global... method extract_features (line 293) | def extract_features(self, inputs): method forward (line 319) | def forward(self, inputs): function round_filters (line 360) | def round_filters(filters, global_params): function round_repeats (line 388) | def round_repeats(repeats, global_params): function drop_connect (line 406) | def drop_connect(inputs: torch.Tensor, p: float, training: bool) -> torc... function get_width_and_height_from_size (line 436) | def get_width_and_height_from_size(x): function calculate_output_image_size (line 453) | def calculate_output_image_size(input_image_size, stride): function get_same_padding_conv2d (line 479) | def get_same_padding_conv2d(image_size=None): class Conv2dDynamicSamePadding (line 495) | class Conv2dDynamicSamePadding(nn.Conv2d): method __init__ (line 512) | def __init__( method forward (line 527) | def forward(self, x): class Conv2dStaticSamePadding (line 552) | class Conv2dStaticSamePadding(nn.Conv2d): method __init__ (line 559) | def __init__( method forward (line 586) | def forward(self, x): function get_same_padding_maxPool2d (line 600) | def get_same_padding_maxPool2d(image_size=None): class MaxPool2dDynamicSamePadding (line 616) | class MaxPool2dDynamicSamePadding(nn.MaxPool2d): method __init__ (line 621) | def __init__( method forward (line 643) | def forward(self, x): class MaxPool2dStaticSamePadding (line 665) | class MaxPool2dStaticSamePadding(nn.MaxPool2d): method __init__ (line 670) | def __init__(self, kernel_size, stride, image_size=None, **kwargs): method forward (line 697) | def forward(self, x): class BlockDecoder (line 721) | class BlockDecoder(object): method _decode_block_string (line 727) | def _decode_block_string(block_string): method decode (line 764) | def decode(string_list): function efficientnet_params (line 780) | def efficientnet_params(model_name): function efficientnet (line 805) | def efficientnet( function get_model_params (line 860) | def get_model_params(model_name, override_params): FILE: segmentation_models_pytorch/encoders/_inceptionresnetv2.py class BasicConv2d (line 5) | class BasicConv2d(nn.Module): method __init__ (line 6) | def __init__(self, in_planes, out_planes, kernel_size, stride, padding... method forward (line 24) | def forward(self, x): class Mixed_5b (line 31) | class Mixed_5b(nn.Module): method __init__ (line 32) | def __init__(self): method forward (line 53) | def forward(self, x): class Block35 (line 62) | class Block35(nn.Module): method __init__ (line 63) | def __init__(self, scale=1.0): method forward (line 84) | def forward(self, x): class Mixed_6a (line 95) | class Mixed_6a(nn.Module): method __init__ (line 96) | def __init__(self): method forward (line 109) | def forward(self, x): class Block17 (line 117) | class Block17(nn.Module): method __init__ (line 118) | def __init__(self, scale=1.0): method forward (line 134) | def forward(self, x): class Mixed_7a (line 144) | class Mixed_7a(nn.Module): method __init__ (line 145) | def __init__(self): method forward (line 166) | def forward(self, x): class Block8 (line 175) | class Block8(nn.Module): method __init__ (line 176) | def __init__(self, scale=1.0, noReLU=False): method forward (line 194) | def forward(self, x): class InceptionResNetV2 (line 205) | class InceptionResNetV2(nn.Module): method __init__ (line 206) | def __init__(self, num_classes=1001): method features (line 274) | def features(self, input): method logits (line 292) | def logits(self, features): method forward (line 298) | def forward(self, input): FILE: segmentation_models_pytorch/encoders/_inceptionv4.py class BasicConv2d (line 6) | class BasicConv2d(nn.Module): method __init__ (line 7) | def __init__(self, in_planes, out_planes, kernel_size, stride, padding... method forward (line 25) | def forward(self, x): class Mixed_3a (line 32) | class Mixed_3a(nn.Module): method __init__ (line 33) | def __init__(self): method forward (line 38) | def forward(self, x): class Mixed_4a (line 45) | class Mixed_4a(nn.Module): method __init__ (line 46) | def __init__(self): method forward (line 61) | def forward(self, x): class Mixed_5a (line 68) | class Mixed_5a(nn.Module): method __init__ (line 69) | def __init__(self): method forward (line 74) | def forward(self, x): class Inception_A (line 81) | class Inception_A(nn.Module): method __init__ (line 82) | def __init__(self): method forward (line 102) | def forward(self, x): class Reduction_A (line 111) | class Reduction_A(nn.Module): method __init__ (line 112) | def __init__(self): method forward (line 124) | def forward(self, x): class Inception_B (line 132) | class Inception_B(nn.Module): method __init__ (line 133) | def __init__(self): method forward (line 156) | def forward(self, x): class Reduction_B (line 165) | class Reduction_B(nn.Module): method __init__ (line 166) | def __init__(self): method forward (line 183) | def forward(self, x): class Inception_C (line 191) | class Inception_C(nn.Module): method __init__ (line 192) | def __init__(self): method forward (line 224) | def forward(self, x): class InceptionV4 (line 245) | class InceptionV4(nn.Module): method __init__ (line 246) | def __init__(self, num_classes=1001): method logits (line 280) | def logits(self, features): method forward (line 288) | def forward(self, input): FILE: segmentation_models_pytorch/encoders/_preprocessing.py function preprocess_input (line 4) | def preprocess_input( FILE: segmentation_models_pytorch/encoders/_senet.py class SEModule (line 12) | class SEModule(nn.Module): method __init__ (line 13) | def __init__(self, channels, reduction): method forward (line 21) | def forward(self, x): class Bottleneck (line 31) | class Bottleneck(nn.Module): method forward (line 36) | def forward(self, x): class SEBottleneck (line 59) | class SEBottleneck(Bottleneck): method __init__ (line 66) | def __init__(self, inplanes, planes, groups, reduction, stride=1, down... class SEResNetBottleneck (line 88) | class SEResNetBottleneck(Bottleneck): method __init__ (line 97) | def __init__(self, inplanes, planes, groups, reduction, stride=1, down... class SEResNeXtBottleneck (line 115) | class SEResNeXtBottleneck(Bottleneck): method __init__ (line 122) | def __init__( class SENet (line 154) | class SENet(nn.Module): method __init__ (line 155) | def __init__( method _make_layer (line 283) | def _make_layer( method features (line 318) | def features(self, x): method logits (line 326) | def logits(self, x): method forward (line 334) | def forward(self, x): FILE: segmentation_models_pytorch/encoders/_utils.py function patch_first_conv (line 5) | def patch_first_conv(model, new_in_channels, default_in_channels=3, pret... function replace_strides_with_dilation (line 46) | def replace_strides_with_dilation(module, dilation_rate): FILE: segmentation_models_pytorch/encoders/_xception.py class SeparableConv2d (line 29) | class SeparableConv2d(nn.Module): method __init__ (line 30) | def __init__( method forward (line 54) | def forward(self, x): class Block (line 60) | class Block(nn.Module): method __init__ (line 61) | def __init__( method forward (line 118) | def forward(self, inp): class Xception (line 131) | class Xception(nn.Module): method __init__ (line 137) | def __init__(self, num_classes=1000): method features (line 190) | def features(self, input): method logits (line 220) | def logits(self, features): method forward (line 228) | def forward(self, input): FILE: segmentation_models_pytorch/encoders/densenet.py class DenseNetEncoder (line 33) | class DenseNetEncoder(DenseNet, EncoderMixin): method __init__ (line 34) | def __init__(self, out_channels, depth=5, output_stride=32, **kwargs): method make_dilated (line 48) | def make_dilated(self, *args, **kwargs): method forward (line 54) | def forward(self, x): method load_state_dict (line 95) | def load_state_dict(self, state_dict): FILE: segmentation_models_pytorch/encoders/dpn.py class DPNEncoder (line 34) | class DPNEncoder(DPN, EncoderMixin): method __init__ (line 38) | def __init__( method get_stages (line 60) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 66) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 97) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/efficientnet.py class EfficientNetEncoder (line 33) | class EfficientNetEncoder(EfficientNet, EncoderMixin): method __init__ (line 34) | def __init__( method get_stages (line 59) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 65) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 90) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/inceptionresnetv2.py class InceptionResNetV2Encoder (line 34) | class InceptionResNetV2Encoder(InceptionResNetV2, EncoderMixin): method __init__ (line 35) | def __init__( method make_dilated (line 69) | def make_dilated(self, *args, **kwargs): method forward (line 75) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 110) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/inceptionv4.py class InceptionV4Encoder (line 35) | class InceptionV4Encoder(InceptionV4, EncoderMixin): method __init__ (line 36) | def __init__( method make_dilated (line 66) | def make_dilated(self, *args, **kwargs): method forward (line 72) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 91) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/mix_transformer.py class LayerNorm (line 21) | class LayerNorm(nn.LayerNorm): method forward (line 22) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Mlp (line 33) | class Mlp(nn.Module): method __init__ (line 34) | def __init__( method _init_weights (line 53) | def _init_weights(self, m): method forward (line 65) | def forward(self, x: torch.Tensor, height: int, width: int) -> torch.T... class Attention (line 75) | class Attention(nn.Module): method __init__ (line 76) | def __init__( method _init_weights (line 113) | def _init_weights(self, m): method forward (line 128) | def forward(self, x: torch.Tensor, height: int, width: int) -> torch.T... class Block (line 164) | class Block(nn.Module): method __init__ (line 165) | def __init__( method _init_weights (line 203) | def _init_weights(self, m): method forward (line 218) | def forward(self, x: torch.Tensor) -> torch.Tensor: class OverlapPatchEmbed (line 227) | class OverlapPatchEmbed(nn.Module): method __init__ (line 230) | def __init__(self, img_size=224, patch_size=7, stride=4, in_chans=3, e... method _init_weights (line 250) | def _init_weights(self, m): method forward (line 265) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MixVisionTransformer (line 271) | class MixVisionTransformer(nn.Module): method __init__ (line 272) | def __init__( method _init_weights (line 413) | def _init_weights(self, m): method init_weights (line 428) | def init_weights(self, pretrained=None): method reset_drop_path (line 431) | def reset_drop_path(self, drop_path_rate): method freeze_patch_emb (line 449) | def freeze_patch_emb(self): method no_weight_decay (line 453) | def no_weight_decay(self): method get_classifier (line 462) | def get_classifier(self): method reset_classifier (line 465) | def reset_classifier(self, num_classes, global_pool=""): method forward_features (line 471) | def forward_features(self, x: torch.Tensor) -> List[torch.Tensor]: method forward (line 500) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: class DWConv (line 507) | class DWConv(nn.Module): method __init__ (line 508) | def __init__(self, dim=768): method forward (line 512) | def forward(self, x: torch.Tensor, height: int, width: int) -> torch.T... class MixVisionTransformerEncoder (line 528) | class MixVisionTransformerEncoder(MixVisionTransformer, EncoderMixin): method __init__ (line 529) | def __init__( method get_stages (line 543) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 549) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 588) | def load_state_dict(self, state_dict): FILE: segmentation_models_pytorch/encoders/mobilenet.py class MobileNetV2Encoder (line 33) | class MobileNetV2Encoder(torchvision.models.MobileNetV2, EncoderMixin): method __init__ (line 34) | def __init__( method get_stages (line 51) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 57) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 77) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/mobileone.py class SEBlock (line 18) | class SEBlock(nn.Module): method __init__ (line 25) | def __init__(self, in_channels: int, rd_ratio: float = 0.0625) -> None: method forward (line 47) | def forward(self, inputs: torch.Tensor) -> torch.Tensor: class MobileOneBlock (line 59) | class MobileOneBlock(nn.Module): method __init__ (line 69) | def __init__( method forward (line 143) | def forward(self, x: torch.Tensor) -> torch.Tensor: method reparameterize (line 167) | def reparameterize(self): method _get_kernel_bias (line 199) | def _get_kernel_bias(self) -> Tuple[torch.Tensor, torch.Tensor]: method _fuse_bn_tensor (line 232) | def _fuse_bn_tensor(self, branch) -> Tuple[torch.Tensor, torch.Tensor]: method _conv_bn (line 270) | def _conv_bn(self, kernel_size: int, padding: int) -> nn.Sequential: class MobileOne (line 294) | class MobileOne(nn.Module, EncoderMixin): method __init__ (line 301) | def __init__( method get_stages (line 367) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method _make_stage (line 373) | def _make_stage( method forward (line 425) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 451) | def load_state_dict(self, state_dict, **kwargs): method set_in_channels (line 456) | def set_in_channels(self, in_channels, pretrained=True): function reparameterize_model (line 475) | def reparameterize_model(model: torch.nn.Module) -> nn.Module: FILE: segmentation_models_pytorch/encoders/resnet.py class ResNetEncoder (line 35) | class ResNetEncoder(ResNet, EncoderMixin): method __init__ (line 38) | def __init__( method get_stages (line 55) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 61) | def forward(self, x: torch.Tensor) -> list[torch.Tensor]: method load_state_dict (line 89) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/senet.py class SENetEncoder (line 38) | class SENetEncoder(SENet, EncoderMixin): method __init__ (line 39) | def __init__( method get_stages (line 64) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 70) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 96) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/timm_efficientnet.py function get_efficientnet_kwargs (line 14) | def get_efficientnet_kwargs( function gen_efficientnet_lite_kwargs (line 57) | def gen_efficientnet_lite_kwargs( class EfficientNetBaseEncoder (line 99) | class EfficientNetBaseEncoder(EfficientNet, EncoderMixin): method __init__ (line 100) | def __init__( method get_stages (line 122) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 128) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 157) | def load_state_dict(self, state_dict, **kwargs): class EfficientNetEncoder (line 163) | class EfficientNetEncoder(EfficientNetBaseEncoder): method __init__ (line 164) | def __init__( class EfficientNetLiteEncoder (line 186) | class EfficientNetLiteEncoder(EfficientNetBaseEncoder): method __init__ (line 187) | def __init__( function prepare_settings (line 209) | def prepare_settings(settings): FILE: segmentation_models_pytorch/encoders/timm_sknet.py class SkNetEncoder (line 9) | class SkNetEncoder(ResNet, EncoderMixin): method __init__ (line 10) | def __init__( method get_stages (line 31) | def get_stages(self) -> Dict[int, Sequence[torch.nn.Module]]: method forward (line 37) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 65) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/timm_universal.py class TimmUniversalEncoder (line 36) | class TimmUniversalEncoder(nn.Module): method __init__ (line 51) | def __init__( method forward (line 160) | def forward(self, x: torch.Tensor) -> list[torch.Tensor]: method out_channels (line 191) | def out_channels(self) -> list[int]: method output_stride (line 201) | def output_stride(self) -> int: method load_state_dict (line 210) | def load_state_dict(self, state_dict, **kwargs): function _merge_kwargs_no_duplicates (line 232) | def _merge_kwargs_no_duplicates(a: dict[str, Any], b: dict[str, Any]) ->... FILE: segmentation_models_pytorch/encoders/timm_vit.py function sample_block_indices_uniformly (line 10) | def sample_block_indices_uniformly(n: int, total_num_blocks: int) -> lis... function validate_output_indices (line 19) | def validate_output_indices( function preprocess_output_indices (line 35) | def preprocess_output_indices( class TimmViTEncoder (line 54) | class TimmViTEncoder(nn.Module): method __init__ (line 69) | def __init__( method _forward_with_prefix_tokens (line 149) | def _forward_with_prefix_tokens( method _forward_without_prefix_tokens (line 164) | def _forward_without_prefix_tokens(self, x: torch.Tensor) -> list[torc... method forward (line 172) | def forward( FILE: segmentation_models_pytorch/encoders/vgg.py class VGGEncoder (line 46) | class VGGEncoder(VGG, EncoderMixin): method __init__ (line 47) | def __init__( method make_dilated (line 75) | def make_dilated(self, *args, **kwargs): method forward (line 81) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method load_state_dict (line 101) | def load_state_dict(self, state_dict, **kwargs): FILE: segmentation_models_pytorch/encoders/xception.py class XceptionEncoder (line 7) | class XceptionEncoder(Xception, EncoderMixin): method __init__ (line 8) | def __init__( method make_dilated (line 33) | def make_dilated(self, *args, **kwargs): method forward (line 39) | def forward(self, x): method load_state_dict (line 82) | def load_state_dict(self, state_dict): FILE: segmentation_models_pytorch/losses/_functional.py function to_tensor (line 19) | def to_tensor(x, dtype=None) -> torch.Tensor: function focal_loss_with_logits (line 37) | def focal_loss_with_logits( function softmax_focal_loss_with_logits (line 100) | def softmax_focal_loss_with_logits( function soft_jaccard_score (line 153) | def soft_jaccard_score( function soft_dice_score (line 165) | def soft_dice_score( function soft_tversky_score (line 177) | def soft_tversky_score( function wing_loss (line 214) | def wing_loss( function label_smoothed_nll_loss (line 243) | def label_smoothed_nll_loss( FILE: segmentation_models_pytorch/losses/dice.py class DiceLoss (line 12) | class DiceLoss(_Loss): method __init__ (line 13) | def __init__( method forward (line 70) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... method aggregate_loss (line 142) | def aggregate_loss(self, loss: torch.Tensor) -> torch.Tensor: method compute_score (line 159) | def compute_score( FILE: segmentation_models_pytorch/losses/focal.py class FocalLoss (line 12) | class FocalLoss(_Loss): method __init__ (line 13) | def __init__( method forward (line 77) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... FILE: segmentation_models_pytorch/losses/jaccard.py class JaccardLoss (line 12) | class JaccardLoss(_Loss): method __init__ (line 13) | def __init__( method forward (line 70) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... FILE: segmentation_models_pytorch/losses/lovasz.py function _lovasz_grad (line 22) | def _lovasz_grad(gt_sorted): function _lovasz_hinge (line 36) | def _lovasz_hinge(logits, labels, per_image=True, ignore=None): function _lovasz_hinge_flat (line 56) | def _lovasz_hinge_flat(logits, labels): function _flatten_binary_scores (line 76) | def _flatten_binary_scores(scores, labels, ignore=None): function _lovasz_softmax (line 93) | def _lovasz_softmax(probas, labels, classes="present", per_image=False, ... function _lovasz_softmax_flat (line 118) | def _lovasz_softmax_flat(probas, labels, classes="present"): function _flatten_probas (line 149) | def _flatten_probas(probas, labels, ignore=None): function isnan (line 170) | def isnan(x): function mean (line 174) | def mean(values, ignore_nan=False, empty=0): class LovaszLoss (line 193) | class LovaszLoss(_Loss): method __init__ (line 194) | def __init__( method forward (line 223) | def forward(self, y_pred, y_true): FILE: segmentation_models_pytorch/losses/mcc.py class MCCLoss (line 5) | class MCCLoss(_Loss): method __init__ (line 6) | def __init__(self, eps: float = 1e-5): method forward (line 19) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... FILE: segmentation_models_pytorch/losses/soft_bce.py class SoftBCEWithLogitsLoss (line 10) | class SoftBCEWithLogitsLoss(nn.Module): method __init__ (line 19) | def __init__( method forward (line 48) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... FILE: segmentation_models_pytorch/losses/soft_ce.py class SoftCrossEntropyLoss (line 10) | class SoftCrossEntropyLoss(nn.Module): method __init__ (line 13) | def __init__( method forward (line 38) | def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch... FILE: segmentation_models_pytorch/losses/tversky.py class TverskyLoss (line 11) | class TverskyLoss(DiceLoss): method __init__ (line 37) | def __init__( method aggregate_loss (line 66) | def aggregate_loss(self, loss: torch.Tensor) -> torch.Tensor: method compute_score (line 82) | def compute_score( FILE: segmentation_models_pytorch/metrics/functional.py function get_stats (line 62) | def get_stats( function _get_stats_multiclass (line 179) | def _get_stats_multiclass( function _get_stats_multilabel (line 225) | def _get_stats_multilabel( function _handle_zero_division (line 245) | def _handle_zero_division(x, zero_division): function _compute_metric (line 255) | def _compute_metric( function _fbeta_score (line 330) | def _fbeta_score(tp, fp, fn, tn, beta=1): function _iou_score (line 337) | def _iou_score(tp, fp, fn, tn): function _accuracy (line 341) | def _accuracy(tp, fp, fn, tn): function _sensitivity (line 345) | def _sensitivity(tp, fp, fn, tn): function _specificity (line 349) | def _specificity(tp, fp, fn, tn): function _balanced_accuracy (line 353) | def _balanced_accuracy(tp, fp, fn, tn): function _positive_predictive_value (line 357) | def _positive_predictive_value(tp, fp, fn, tn): function _negative_predictive_value (line 361) | def _negative_predictive_value(tp, fp, fn, tn): function _false_negative_rate (line 365) | def _false_negative_rate(tp, fp, fn, tn): function _false_positive_rate (line 369) | def _false_positive_rate(tp, fp, fn, tn): function _false_discovery_rate (line 373) | def _false_discovery_rate(tp, fp, fn, tn): function _false_omission_rate (line 377) | def _false_omission_rate(tp, fp, fn, tn): function _positive_likelihood_ratio (line 381) | def _positive_likelihood_ratio(tp, fp, fn, tn): function _negative_likelihood_ratio (line 385) | def _negative_likelihood_ratio(tp, fp, fn, tn): function fbeta_score (line 389) | def fbeta_score( function f1_score (line 413) | def f1_score( function iou_score (line 436) | def iou_score( function accuracy (line 458) | def accuracy( function sensitivity (line 480) | def sensitivity( function specificity (line 502) | def specificity( function balanced_accuracy (line 524) | def balanced_accuracy( function positive_predictive_value (line 546) | def positive_predictive_value( function negative_predictive_value (line 568) | def negative_predictive_value( function false_negative_rate (line 590) | def false_negative_rate( function false_positive_rate (line 612) | def false_positive_rate( function false_discovery_rate (line 634) | def false_discovery_rate( function false_omission_rate (line 656) | def false_omission_rate( function positive_likelihood_ratio (line 678) | def positive_likelihood_ratio( function negative_likelihood_ratio (line 700) | def negative_likelihood_ratio( FILE: segmentation_models_pytorch/utils/base.py class BaseObject (line 5) | class BaseObject(nn.Module): method __init__ (line 6) | def __init__(self, name=None): method __name__ (line 11) | def __name__(self): class Metric (line 20) | class Metric(BaseObject): class Loss (line 24) | class Loss(BaseObject): method __add__ (line 25) | def __add__(self, other): method __radd__ (line 31) | def __radd__(self, other): method __mul__ (line 34) | def __mul__(self, value): method __rmul__ (line 40) | def __rmul__(self, other): class SumOfLosses (line 44) | class SumOfLosses(Loss): method __init__ (line 45) | def __init__(self, l1, l2): method __call__ (line 51) | def __call__(self, *inputs): class MultipliedLoss (line 55) | class MultipliedLoss(Loss): method __init__ (line 56) | def __init__(self, loss, multiplier): method __call__ (line 66) | def __call__(self, *inputs): FILE: segmentation_models_pytorch/utils/functional.py function _take_channels (line 4) | def _take_channels(*xs, ignore_channels=None): function _threshold (line 20) | def _threshold(x, threshold=None): function iou (line 27) | def iou(pr, gt, eps=1e-7, threshold=None, ignore_channels=None): function f_score (line 49) | def f_score(pr, gt, beta=1, eps=1e-7, threshold=None, ignore_channels=No... function accuracy (line 73) | def accuracy(pr, gt, threshold=0.5, ignore_channels=None): function precision (line 91) | def precision(pr, gt, eps=1e-7, threshold=None, ignore_channels=None): function recall (line 113) | def recall(pr, gt, eps=1e-7, threshold=None, ignore_channels=None): FILE: segmentation_models_pytorch/utils/losses.py class JaccardLoss (line 8) | class JaccardLoss(base.Loss): method __init__ (line 9) | def __init__(self, eps=1.0, activation=None, ignore_channels=None, **k... method forward (line 15) | def forward(self, y_pr, y_gt): class DiceLoss (line 26) | class DiceLoss(base.Loss): method __init__ (line 27) | def __init__( method forward (line 36) | def forward(self, y_pr, y_gt): class L1Loss (line 48) | class L1Loss(nn.L1Loss, base.Loss): class MSELoss (line 52) | class MSELoss(nn.MSELoss, base.Loss): class CrossEntropyLoss (line 56) | class CrossEntropyLoss(nn.CrossEntropyLoss, base.Loss): class NLLLoss (line 60) | class NLLLoss(nn.NLLLoss, base.Loss): class BCELoss (line 64) | class BCELoss(nn.BCELoss, base.Loss): class BCEWithLogitsLoss (line 68) | class BCEWithLogitsLoss(nn.BCEWithLogitsLoss, base.Loss): FILE: segmentation_models_pytorch/utils/meter.py class Meter (line 4) | class Meter(object): method reset (line 9) | def reset(self): method add (line 13) | def add(self, value): method value (line 20) | def value(self): class AverageValueMeter (line 25) | class AverageValueMeter(Meter): method __init__ (line 26) | def __init__(self): method add (line 31) | def add(self, value, n=1): method value (line 50) | def value(self): method reset (line 53) | def reset(self): FILE: segmentation_models_pytorch/utils/metrics.py class IoU (line 6) | class IoU(base.Metric): method __init__ (line 9) | def __init__( method forward (line 18) | def forward(self, y_pr, y_gt): class Fscore (line 29) | class Fscore(base.Metric): method __init__ (line 30) | def __init__( method forward (line 46) | def forward(self, y_pr, y_gt): class Accuracy (line 58) | class Accuracy(base.Metric): method __init__ (line 59) | def __init__(self, threshold=0.5, activation=None, ignore_channels=Non... method forward (line 65) | def forward(self, y_pr, y_gt): class Recall (line 72) | class Recall(base.Metric): method __init__ (line 73) | def __init__( method forward (line 82) | def forward(self, y_pr, y_gt): class Precision (line 93) | class Precision(base.Metric): method __init__ (line 94) | def __init__( method forward (line 103) | def forward(self, y_pr, y_gt): FILE: segmentation_models_pytorch/utils/train.py class Epoch (line 7) | class Epoch: method __init__ (line 8) | def __init__(self, model, loss, metrics, stage_name, device="cpu", ver... method _to_device (line 18) | def _to_device(self): method _format_logs (line 24) | def _format_logs(self, logs): method batch_update (line 29) | def batch_update(self, x, y): method on_epoch_start (line 32) | def on_epoch_start(self): method run (line 35) | def run(self, dataloader): class TrainEpoch (line 74) | class TrainEpoch(Epoch): method __init__ (line 75) | def __init__(self, model, loss, metrics, optimizer, device="cpu", verb... method on_epoch_start (line 86) | def on_epoch_start(self): method batch_update (line 89) | def batch_update(self, x, y): class ValidEpoch (line 98) | class ValidEpoch(Epoch): method __init__ (line 99) | def __init__(self, model, loss, metrics, device="cpu", verbose=True): method on_epoch_start (line 109) | def on_epoch_start(self): method batch_update (line 112) | def batch_update(self, x, y): FILE: tests/base/test_freeze_encoder.py function test_freeze_and_unfreeze_encoder (line 5) | def test_freeze_and_unfreeze_encoder(): function test_freeze_encoder_stops_running_stats (line 50) | def test_freeze_encoder_stops_running_stats(): FILE: tests/base/test_modules.py function test_conv2drelu_batchnorm (line 6) | def test_conv2drelu_batchnorm(): function test_conv2drelu_batchnorm_with_keywords (line 14) | def test_conv2drelu_batchnorm_with_keywords(): function test_conv2drelu_identity (line 29) | def test_conv2drelu_identity(): function test_conv2drelu_layernorm (line 37) | def test_conv2drelu_layernorm(): function test_conv2drelu_instancenorm (line 45) | def test_conv2drelu_instancenorm(): function test_conv2drelu_inplace (line 53) | def test_conv2drelu_inplace(): FILE: tests/conftest.py function pytest_addoption (line 1) | def pytest_addoption(parser): function pytest_collection_modifyitems (line 7) | def pytest_collection_modifyitems(config, items): FILE: tests/encoders/base.py class BaseEncoderTester (line 14) | class BaseEncoderTester(unittest.TestCase): method get_tiny_encoder (line 36) | def get_tiny_encoder(self): method _get_sample (line 40) | def _get_sample(self, batch_size=None, num_channels=None, height=None,... method get_features_output_strides (line 47) | def get_features_output_strides(self, sample, features): method test_forward_backward (line 53) | def test_forward_backward(self): method test_in_channels (line 73) | def test_in_channels(self): method test_depth (line 93) | def test_depth(self): method test_invalid_depth (line 152) | def test_invalid_depth(self): method test_dilated (line 158) | def test_dilated(self): method test_compile (line 212) | def test_compile(self): method test_torch_export (line 234) | def test_torch_export(self): method test_torch_script (line 266) | def test_torch_script(self): FILE: tests/encoders/test_batchnorm_deprecation.py function test_seg_models_before_after_use_norm (line 11) | def test_seg_models_before_after_use_norm(model_name, decoder_option): function test_pspnet_before_after_use_norm (line 35) | def test_pspnet_before_after_use_norm(decoder_option): FILE: tests/encoders/test_common.py function test_load_encoder_from_hub (line 13) | def test_load_encoder_from_hub(encoder_name_and_weights): FILE: tests/encoders/test_pretrainedmodels_encoders.py class TestDPNEncoder (line 7) | class TestDPNEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 15) | def get_tiny_encoder(self): class TestInceptionResNetV2Encoder (line 31) | class TestInceptionResNetV2Encoder(base.BaseEncoderTester): class TestInceptionV4Encoder (line 39) | class TestInceptionV4Encoder(base.BaseEncoderTester): class TestSeNetEncoder (line 45) | class TestSeNetEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 60) | def get_tiny_encoder(self): class TestXceptionEncoder (line 77) | class TestXceptionEncoder(base.BaseEncoderTester): FILE: tests/encoders/test_smp_encoders.py class TestMobileoneEncoder (line 8) | class TestMobileoneEncoder(base.BaseEncoderTester): class TestMixTransformerEncoder (line 23) | class TestMixTransformerEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 31) | def get_tiny_encoder(self): class TestEfficientNetEncoder (line 49) | class TestEfficientNetEncoder(base.BaseEncoderTester): FILE: tests/encoders/test_timm_ported_encoders.py class TestTimmEfficientNetEncoder (line 5) | class TestTimmEfficientNetEncoder(base.BaseEncoderTester): class TestTimmGERNetEncoder (line 30) | class TestTimmGERNetEncoder(base.BaseEncoderTester): method test_compile (line 37) | def test_compile(self): class TestTimmMobileNetV3Encoder (line 41) | class TestTimmMobileNetV3Encoder(base.BaseEncoderTester): method test_compile (line 55) | def test_compile(self): class TestTimmRegNetEncoder (line 59) | class TestTimmRegNetEncoder(base.BaseEncoderTester): method test_compile (line 91) | def test_compile(self): class TestTimmRes2NetEncoder (line 95) | class TestTimmRes2NetEncoder(base.BaseEncoderTester): method test_compile (line 110) | def test_compile(self): class TestTimmResnestEncoder (line 114) | class TestTimmResnestEncoder(base.BaseEncoderTester): method test_compile (line 131) | def test_compile(self): class TestTimmSkNetEncoder (line 135) | class TestTimmSkNetEncoder(base.BaseEncoderTester): FILE: tests/encoders/test_timm_universal.py class TestTimmUniversalEncoder (line 20) | class TestTimmUniversalEncoder(base.BaseEncoderTester): class TestTimmUniversalEncoderWeightsWarning (line 25) | class TestTimmUniversalEncoderWeightsWarning(unittest.TestCase): method test_string_weights_emits_warning (line 28) | def test_string_weights_emits_warning(self): method test_true_weights_no_warning (line 32) | def test_true_weights_no_warning(self): method test_none_weights_no_warning (line 37) | def test_none_weights_no_warning(self): FILE: tests/encoders/test_timm_vit_encoders.py class TestTimmViTEncoders (line 20) | class TestTimmViTEncoders(base.BaseEncoderTester): method get_tiny_encoder (line 35) | def get_tiny_encoder(self) -> TimmViTEncoder: method get_encoder (line 43) | def get_encoder(self, encoder_name: str, **kwargs) -> TimmViTEncoder: method test_forward_backward (line 53) | def test_forward_backward(self): method test_in_channels (line 77) | def test_in_channels(self): method test_depth (line 97) | def test_depth(self): method test_invalid_depth (line 157) | def test_invalid_depth(self): method test_invalid_out_indices (line 163) | def test_invalid_out_indices(self): method test_dilated (line 180) | def test_dilated(self): method test_compile (line 184) | def test_compile(self): method test_torch_export (line 208) | def test_torch_export(self): method test_torch_script (line 233) | def test_torch_script(self): FILE: tests/encoders/test_torchvision_encoders.py class TestResNetEncoder (line 7) | class TestResNetEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 27) | def get_tiny_encoder(self): class TestDenseNetEncoder (line 36) | class TestDenseNetEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 45) | def get_tiny_encoder(self): class TestMobileNetEncoder (line 55) | class TestMobileNetEncoder(base.BaseEncoderTester): class TestVggEncoder (line 60) | class TestVggEncoder(base.BaseEncoderTester): method get_tiny_encoder (line 78) | def get_tiny_encoder(self): FILE: tests/models/base.py class BaseModelTester (line 21) | class BaseModelTester(unittest.TestCase): method model_type (line 39) | def model_type(self): method hub_checkpoint (line 45) | def hub_checkpoint(self): method model_class (line 49) | def model_class(self): method decoder_channels (line 53) | def decoder_channels(self): method _get_sample (line 61) | def _get_sample(self, batch_size=None, num_channels=None, height=None,... method get_default_model (line 69) | def get_default_model(self): method test_forward_backward (line 74) | def test_forward_backward(self): method test_in_channels_and_depth_and_out_classes (line 94) | def test_in_channels_and_depth_and_out_classes( method test_classification_head (line 126) | def test_classification_head(self): method test_any_resolution (line 154) | def test_any_resolution(self): method test_save_load_with_hub_mixin (line 174) | def test_save_load_with_hub_mixin(self): method test_preserve_forward_output (line 207) | def test_preserve_forward_output(self): method test_compile (line 231) | def test_compile(self): method test_torch_export (line 255) | def test_torch_export(self, eps=1e-5): method test_torch_script (line 278) | def test_torch_script(self): FILE: tests/models/test_deeplab.py class TestDeeplabV3Model (line 4) | class TestDeeplabV3Model(base.BaseModelTester): class TestDeeplabV3PlusModel (line 11) | class TestDeeplabV3PlusModel(base.BaseModelTester): FILE: tests/models/test_dpt.py class TestDPTModel (line 14) | class TestDPTModel(base.BaseModelTester): method decoder_channels (line 27) | def decoder_channels(self): method hub_checkpoint (line 32) | def hub_checkpoint(self): method test_load_pretrained (line 38) | def test_load_pretrained(self): FILE: tests/models/test_fpn.py class TestFpnModel (line 6) | class TestFpnModel(base.BaseModelTester): method test_interpolation (line 10) | def test_interpolation(self): FILE: tests/models/test_linknet.py class TestLinknetModel (line 8) | class TestLinknetModel(base.BaseModelTester): method test_timm_transformer_style_encoder (line 12) | def test_timm_transformer_style_encoder(self): FILE: tests/models/test_manet.py class TestManetModel (line 6) | class TestManetModel(base.BaseModelTester): method test_interpolation (line 10) | def test_interpolation(self): FILE: tests/models/test_pan.py class TestPanModel (line 7) | class TestPanModel(base.BaseModelTester): method test_interpolation (line 15) | def test_interpolation(self): FILE: tests/models/test_psp.py class TestPspModel (line 4) | class TestPspModel(base.BaseModelTester): FILE: tests/models/test_segformer.py class TestSegformerModel (line 9) | class TestSegformerModel(base.BaseModelTester): method test_load_pretrained (line 16) | def test_load_pretrained(self): FILE: tests/models/test_unet.py class TestUnetModel (line 5) | class TestUnetModel(base.BaseModelTester): method test_interpolation (line 9) | def test_interpolation(self): FILE: tests/models/test_unetplusplus.py class TestUnetPlusPlusModel (line 7) | class TestUnetPlusPlusModel(base.BaseModelTester): method test_timm_transformer_style_encoder (line 11) | def test_timm_transformer_style_encoder(self): method test_interpolation (line 19) | def test_interpolation(self): FILE: tests/models/test_upernet.py class TestUnetModel (line 6) | class TestUnetModel(base.BaseModelTester): method test_torch_export (line 13) | def test_torch_export(self): FILE: tests/test_base.py function test_from_pretrained_with_mismatched_keys (line 8) | def test_from_pretrained_with_mismatched_keys(): FILE: tests/test_losses.py function test_focal_loss_from_logits_false_multiclass (line 16) | def test_focal_loss_from_logits_false_multiclass(): function test_focal_loss_with_logits (line 42) | def test_focal_loss_with_logits(): function test_softmax_focal_loss_with_logits (line 52) | def test_softmax_focal_loss_with_logits(): function test_soft_jaccard_score (line 70) | def test_soft_jaccard_score(y_true, y_pred, expected, eps): function test_soft_jaccard_score_2 (line 85) | def test_soft_jaccard_score_2(y_true, y_pred, expected, eps): function test_soft_dice_score (line 101) | def test_soft_dice_score(y_true, y_pred, expected, eps): function test_soft_tversky_score (line 116) | def test_soft_tversky_score(y_true, y_pred, expected, eps, alpha, beta): function test_dice_loss_binary (line 124) | def test_dice_loss_binary(): function test_tversky_loss_binary (line 162) | def test_tversky_loss_binary(): function test_binary_jaccard_loss (line 203) | def test_binary_jaccard_loss(): function test_multiclass_jaccard_loss (line 241) | def test_multiclass_jaccard_loss(): function test_multilabel_jaccard_loss (line 268) | def test_multilabel_jaccard_loss(): function test_soft_ce_loss (line 294) | def test_soft_ce_loss(): function test_soft_bce_loss (line 307) | def test_soft_bce_loss(): function test_binary_mcc_loss (line 318) | def test_binary_mcc_loss(): function test_class_weights_uniform_equivalent_to_no_weights_multiclass (line 365) | def test_class_weights_uniform_equivalent_to_no_weights_multiclass(): function test_class_weights_uniform_equivalent_to_no_weights_multilabel (line 383) | def test_class_weights_uniform_equivalent_to_no_weights_multilabel(): function test_class_weights_nonuniform_changes_loss_multiclass (line 401) | def test_class_weights_nonuniform_changes_loss_multiclass(): function test_class_weights_scale_invariant_multiclass (line 418) | def test_class_weights_scale_invariant_multiclass(): function test_class_weights_binary_mode_raises (line 438) | def test_class_weights_binary_mode_raises(): function test_focal_class_weights_uniform_equivalent_to_no_weights (line 446) | def test_focal_class_weights_uniform_equivalent_to_no_weights(): function test_focal_class_weights_scale_invariant (line 461) | def test_focal_class_weights_scale_invariant(): FILE: tests/test_preprocessing.py function _test_preprocessing (line 6) | def _test_preprocessing(inp, out, **params): function test_mean (line 11) | def test_mean(): function test_std (line 18) | def test_std(): function test_input_range (line 25) | def test_input_range(): function test_input_space (line 33) | def test_input_space(): function test_preprocessing_params (line 39) | def test_preprocessing_params(): FILE: tests/utils.py function slow_test (line 21) | def slow_test(test_case): function requires_timm_greater_or_equal (line 31) | def requires_timm_greater_or_equal(version: str): function requires_torch_greater_or_equal (line 40) | def requires_torch_greater_or_equal(version: str): function check_run_test_on_diff_or_main (line 49) | def check_run_test_on_diff_or_main(filepath_patterns: List[str]): function check_two_models_strictly_equal (line 72) | def check_two_models_strictly_equal(