MCPcopy Create free account

hub / github.com/NVlabs/SegFormer / functions

Functions711 in github.com/NVlabs/SegFormer

↓ 41 callersFunctionto_cuda
(module, data)
tests/test_models/test_heads.py:29
↓ 29 callersFunctionresize
(input, size=None, scale_factor=None, mode='nearest', align_corner
mmseg/ops/wrappers.py:8
↓ 24 callersMethod_transform_inputs
Transform inputs for decoder. Args: inputs (list[Tensor]): List of multi-level img features. Returns: Tensor
mmseg/models/decode_heads/decode_head.py:139
↓ 22 callersMethodcls_seg
Classify each pixel with fc.
mmseg/models/decode_heads/point_head.py:108
↓ 19 callersFunction_test_encoder_decoder_forward
(cfg_file)
tests/test_models/test_forward.py:211
↓ 19 callersMethodtrain
Convert the model into training mode while keep normalization layer freezed.
mmseg/models/backbones/unet.py:388
↓ 17 callersMethodinit_weights
(self, pretrained=None)
tests/test_models/test_segmentor.py:54
↓ 16 callersFunctionbuild_dataset
Build datasets.
mmseg/datasets/builder.py:61
↓ 16 callersFunctionbuild_segmentor
Build segmentor.
mmseg/models/builder.py:56
↓ 12 callersFunction_conv_has_norm
(module, sync_bn)
tests/test_models/test_heads.py:18
↓ 12 callersFunctionaccuracy
Calculate accuracy according to the prediction and target. Args: pred (torch.Tensor): The model prediction, shape (N, num_class, ...)
mmseg/models/losses/accuracy.py:4
↓ 12 callersFunctionbuild_loss
Build loss.
mmseg/models/builder.py:51
↓ 11 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
mmseg/models/backbones/mix_transformer.py:21
↓ 11 callersFunctionis_block
Check if is ResNet building block.
tests/test_models/test_backbone.py:17
↓ 10 callersFunctionbuild_dataloader
Build PyTorch DataLoader. In distributed training, each GPU/process has a dataloader. In non-distributed training, there is only one dataload
mmseg/datasets/builder.py:78
↓ 10 callersFunctionmake_divisible
Make divisible function. This function rounds the channel number to the nearest value that can be divisible by the divisor. It is taken from
mmseg/models/utils/make_divisible.py:1
↓ 10 callersFunctionweight_reduce_loss
Apply element-wise weight and reduce loss. Args: loss (Tensor): Element-wise loss. weight (Tensor): Element-wise weights.
mmseg/models/losses/utils.py:26
↓ 9 callersFunctioneval_metrics
Calculate evaluation metrics Args: results (list[ndarray]): List of prediction segmentation maps. gt_seg_maps (list[ndarray]): lis
mmseg/core/evaluation/metrics.py:179
↓ 9 callersFunctionget_root_logger
Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` i
mmseg/utils/logger.py:6
↓ 8 callersFunction_segmentor_forward_train_test
(segmentor)
tests/test_models/test_segmentor.py:81
↓ 8 callersFunctionadd_prefix
Add prefix for dict. Args: inputs (dict): The input dict with str keys. prefix (str): The prefix to add. Returns: d
mmseg/core/utils/misc.py:1
↓ 8 callersFunctionsra_flops
(h, w, r, dim, num_heads)
tools/get_flops.py:22
↓ 7 callersMethodevaluate
Evaluate the dataset. Args: results (list): Testing results of the dataset. metric (str | list[str]): Metrics to be e
mmseg/datasets/custom.py:306
↓ 7 callersFunctionget_palette
Get class palette (RGB) of a dataset.
mmseg/core/evaluation/class_names.py:138
↓ 7 callersFunctionparse_requirements
Parse the package dependencies listed in a requirements file but strips specific versioning information. Args: fname (str): path to r
setup.py:19
↓ 7 callersFunctionprint_log
Print a log message. Args: msg (str): The message to be logged. logger (logging.Logger | str | None): The logger to be used. Some
mmseg/utils/logger.py:29
↓ 6 callersMethodforward_plugin
Forward function for plugins.
mmseg/models/backbones/resnet.py:242
↓ 6 callersFunctionget_classes
Get class names of a dataset.
mmseg/core/evaluation/class_names.py:121
↓ 5 callersFunctionbuild
Build a module. Args: cfg (dict, list[dict]): The config of modules, is is either a dict or a list of configs. regist
mmseg/models/builder.py:13
↓ 5 callersMethodforward
(self, x)
tests/test_models/test_segmentor.py:57
↓ 5 callersMethodforward_test
Args: imgs (List[Tensor]): the outer list indicates test-time augmentations and inner Tensor should have a shape
mmseg/models/segmentors/base.py:76
↓ 5 callersMethodinit_weights
(self, pretrained=None)
mmseg/models/backbones/mobilenet_v3.py:220
↓ 5 callersFunctiontrunc_normal_
r"""Fills the input Tensor with values drawn from a truncated normal distribution. The values are effectively drawn from the normal distributi
mmseg/models/utils/norm.py:42
↓ 4 callersMethod__init__
(self, depth, in_channels=3, stem_channels=64,
mmseg/models/backbones/resnet.py:373
↓ 4 callersMethod__init__
(self, low_in_channels, high_in_channels, channels, out_channels, query_scales, key_pool_scal
mmseg/models/decode_heads/ann_head.py:99
↓ 4 callersMethodbuild_project
Build projection layer for key/query/value/out.
mmseg/models/utils/self_attention_block.py:99
↓ 4 callersMethodconvert
Multiple with alpha and add beat with clip.
mmseg/datasets/pipelines/transforms.py:1130
↓ 4 callersMethodevaluate
Call evaluate function of dataset.
mmseg/core/evaluation/eval_hooks.py:42
↓ 4 callersFunctionnp2tmp
Save ndarray to local numpy file. Args: array (ndarray): Ndarray to save. temp_file_name (str): Numpy file name. If 'temp_file_na
mmseg/apis/test.py:15
↓ 4 callersFunctionreduce_loss
Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum".
mmseg/models/losses/utils.py:6
↓ 4 callersMethodsample
Sample pixels that have high loss or with low prediction confidence. Args: seg_logit (torch.Tensor): segmentation logits, shape (
mmseg/core/seg/sampler/ohem_pixel_sampler.py:30
↓ 4 callersFunctionsingle_gpu_test
Test with single GPU. Args: model (nn.Module): Model to be tested. data_loader (utils.data.Dataloader): Pytorch data loader.
mmseg/apis/test.py:35
↓ 4 callersFunctionto_tensor
Convert objects of various python types to :obj:`torch.Tensor`. Supported types are: :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`S
mmseg/datasets/pipelines/formating.py:11
↓ 3 callersMethod__init__
(self, groups=1, base_width=4, radix=2, re
mmseg/models/backbones/resnest.py:291
↓ 3 callersMethod__init__
(self, in_channels=3, base_channels=64, num_stages=5,
mmseg/models/backbones/unet.py:277
↓ 3 callersMethod__init__
(self, in_channels=3, num_channels=(32, 64, 128), num_block
mmseg/models/backbones/cgnet.py:215
↓ 3 callersMethod__init__
(self, in_channels=3, downsample_dw_channels=(32, 48), glob
mmseg/models/backbones/fast_scnn.py:296
↓ 3 callersFunction_context_for_ohem
()
tests/test_sampler.py:8
↓ 3 callersMethod_make_layer
(self, in_channels, out_channels, blocks,
mmseg/models/backbones/fast_scnn.py:148
↓ 3 callersMethod_make_stage
Make each stage.
mmseg/models/backbones/hrnet.py:454
↓ 3 callersMethod_make_transition_layer
Make transition layer.
mmseg/models/backbones/hrnet.py:371
↓ 3 callersFunctioncheck_norm_state
Check if norm layer is in correct train state.
tests/test_models/test_backbone.py:44
↓ 3 callersMethodcrop
Crop from ``img``
mmseg/datasets/pipelines/transforms.py:750
↓ 3 callersFunctiondigit_version
(version_str)
mmseg/__init__.py:9
↓ 3 callersMethodencode_decode
Encode images with backbone and decode into a semantic segmentation map of the same size as input.
mmseg/models/segmentors/encoder_decoder.py:84
↓ 3 callersMethodforward_train
Placeholder for Forward function for training.
mmseg/models/segmentors/base.py:51
↓ 3 callersMethodforward_train
Forward function for training. Args: img (Tensor): Input images. img_metas (list[dict]): List of image info dict wher
mmseg/models/segmentors/encoder_decoder.py:136
↓ 3 callersMethodinference
Inference with slide/whole style. Args: img (Tensor): The input image of shape (N, 3, H, W). img_meta (dict): Image i
mmseg/models/segmentors/encoder_decoder.py:228
↓ 3 callersMethodinit_weights
Initialize the weights in backbone. Args: pretrained (str, optional): Path to pre-trained weights. Defaults to No
mmseg/models/backbones/cgnet.py:338
↓ 3 callersMethodmake_block_plugins
make plugins for block. Args: in_channels (int): Input channels of plugin. plugins (list[dict]): List of plugins cfg
mmseg/models/backbones/resnet.py:219
↓ 3 callersFunctionmulti_gpu_test
Test model with multiple gpus. This method tests model with multiple gpus and collects the results under two different modes: gpu and cpu mod
mmseg/apis/test.py:103
↓ 3 callersMethodnorm1
nn.Module: the normalization layer named "norm1"
mmseg/models/backbones/hrnet.py:362
↓ 3 callersMethodnorm2
nn.Module: the normalization layer named "norm2"
mmseg/models/backbones/hrnet.py:367
↓ 3 callersMethodnorm3
nn.Module: normalization layer after the third convolution layer
mmseg/models/backbones/resnet.py:260
↓ 3 callersMethodrandom_sample
Randomly sample an img_scale when ``multiscale_mode=='range'``. Args: img_scales (list[tuple]): Images scale range for sampling.
mmseg/datasets/pipelines/transforms.py:313
↓ 3 callersMethodtrain
(self, mode=True)
mmseg/models/backbones/mobilenet_v3.py:249
↓ 3 callersFunctionun_gz
(src, dst)
tools/convert_datasets/stare.py:14
↓ 2 callersMethod__init__
(self, ocr_channels, scale=1, **kwargs)
mmseg/models/decode_heads/ocr_head.py:97
↓ 2 callersMethod__init__
(self, in_channels, channels)
mmseg/models/decode_heads/da_head.py:20
↓ 2 callersMethod__init__
(self)
tests/test_models/test_segmentor.py:50
↓ 2 callersMethod_align
(self, img, size_divisor, interpolation=None)
mmseg/datasets/pipelines/transforms.py:155
↓ 2 callersMethod_freeze_stages
Freeze stages param and norm stats.
mmseg/models/backbones/resnet.py:581
↓ 2 callersMethod_get_coarse_point_feats
Sample from fine grained features. Args: prev_output (list[Tensor]): Prediction of previous decode head. points (Tens
mmseg/models/decode_heads/point_head.py:147
↓ 2 callersFunction_get_config_directory
Find the predefined segmentor config directory.
tests/test_config.py:11
↓ 2 callersMethod_get_fine_grained_point_feats
Sample from fine grained features. Args: x (list[Tensor]): Feature pyramid from by neck or backbone. points (Tensor):
mmseg/models/decode_heads/point_head.py:123
↓ 2 callersFunctionall_zeros
Check if the weight(and bias) is all zero.
tests/test_models/test_backbone.py:31
↓ 2 callersFunctioncheck_norm_state
Check if norm layer is in correct train state.
tests/test_models/test_unet.py:11
↓ 2 callersFunctioncollect_env
Collect the information of the running environments.
mmseg/utils/collect_env.py:7
↓ 2 callersMethodcontrast
Contrast distortion.
mmseg/datasets/pipelines/transforms.py:1145
↓ 2 callersMethodcrop
Crop from ``img``
mmseg/datasets/pipelines/transforms.py:818
↓ 2 callersMethodextract_feat
Extract features from images.
mmseg/models/segmentors/encoder_decoder.py:77
↓ 2 callersFunctionflatten_binary_logits
Flattens predictions in the batch (binary case) Remove labels equal to 'ignore_index'.
mmseg/models/losses/lovasz_loss.py:29
↓ 2 callersFunctionflatten_probs
Flattens predictions in the batch.
mmseg/models/losses/lovasz_loss.py:42
↓ 2 callersMethodforward
Placeholder of forward function.
mmseg/models/decode_heads/decode_head.py:168
↓ 2 callersMethodforward
(self, fine_grained_point_feats, coarse_point_feats)
mmseg/models/decode_heads/point_head.py:115
↓ 2 callersMethodforward
Forward function.
mmseg/models/decode_heads/enc_head.py:129
↓ 2 callersMethodforward
Placeholder of forward function.
mmseg/models/decode_heads/cascade_decode_head.py:14
↓ 2 callersFunctiongenerate_aug_list
(merged_list, excluded_list)
tools/convert_datasets/voc_aug.py:20
↓ 2 callersFunctionget_confusion_matrix
Intersection over Union Args: pred_label (np.ndarray): 2D predict map label (np.ndarray): label 2D label map n
tests/test_metrics.py:6
↓ 2 callersMethodget_crop_bbox
Randomly get a crop bounding box.
mmseg/datasets/pipelines/transforms.py:739
↓ 2 callersMethodget_gt_seg_maps
Get ground truth segmentation maps for evaluation.
mmseg/datasets/custom.py:230
↓ 2 callersFunctioninference_segmentor
Inference image(s) with the segmentor. Args: model (nn.Module): The loaded segmentor. imgs (str/ndarray or list[str/ndarray]): Ei
mmseg/apis/inference.py:69
↓ 2 callersFunctioninit_segmentor
Initialize a segmentor from config file. Args: config (str or :obj:`mmcv.Config`): Config file path or the config object.
mmseg/apis/inference.py:11
↓ 2 callersFunctionis_norm
Check if is one of the norms.
tests/test_models/test_backbone.py:24
↓ 2 callersFunctionlegacy_mean_dice
(results, gt_seg_maps, num_classes, ignore_index)
tests/test_metrics.py:45
↓ 2 callersFunctionlegacy_mean_iou
(results, gt_seg_maps, num_classes, ignore_index)
tests/test_metrics.py:28
↓ 2 callersFunctionlovasz_grad
Computes gradient of the Lovasz extension w.r.t sorted errors. See Alg. 1 in paper.
mmseg/models/losses/lovasz_loss.py:14
↓ 2 callersFunctionlovasz_hinge_flat
Binary Lovasz hinge loss. Args: logits (torch.Tensor): [P], logits at each prediction (between -infty and +infty). la
mmseg/models/losses/lovasz_loss.py:59
↓ 2 callersFunctionlovasz_softmax_flat
Multi-class Lovasz-Softmax loss. Args: probs (torch.Tensor): [P, C], class probabilities at each prediction (between 0 and 1)
mmseg/models/losses/lovasz_loss.py:128
↓ 2 callersFunctionmean_dice
Calculate Mean Dice (mDice) Args: results (list[ndarray]): List of prediction segmentation maps. gt_seg_maps (list[ndarray]): lis
mmseg/core/evaluation/metrics.py:142
next →1–100 of 711, ranked by callers