MCPcopy Create free account

hub / github.com/LeapLabTHU/Agent-Attention / functions

Functions3,501 in github.com/LeapLabTHU/Agent-Attention

↓ 7 callersMethodnorm2
nn.Module: the normalization layer named "norm2"
downstream/segmentation/mmseg/models/backbones/hrnet.py:430
↓ 7 callersMethodnorm3
nn.Module: normalization layer after the third convolution layer
downstream/detection/mmdet/models/backbones/resnet.py:259
↓ 7 callersMethodregress_by_class
Regress the bbox for the predicted class. Used in Cascade R-CNN. Args: rois (Tensor): Rois from `rpn_head` or last stage
downstream/detection/mmdet/models/roi_heads/bbox_heads/bbox_head.py:460
↓ 7 callersMethodset_extra_property
Set user-defined new property.
downstream/detection/mmdet/core/bbox/assigners/assign_result.py:56
↓ 7 callersFunctionweight_reduce_loss
Apply element-wise weight and reduce loss. Args: loss (Tensor): Element-wise loss. weight (Tensor): Element-wise weights.
downstream/segmentation/mmseg/models/losses/utils.py:48
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
downstream/detection/mmdet/models/backbones/swin_bsl.py:19
↓ 6 callersMethod__init__
(self, in_channels, out_channels, exp_ratio=6,
downstream/segmentation/mmseg/models/backbones/bisenetv2.py:201
↓ 6 callersMethod__init__
(self, in_channels=3, embed_dims=[64, 128, 256], patch_size
downstream/segmentation/mmseg/models/backbones/twins.py:547
↓ 6 callersMethod_bbox_post_process
bbox post-processing method. The boxes would be rescaled to the original image scale and do the nms operation. Usually with_nms is Fa
downstream/detection/mmdet/models/dense_heads/paa_head.py:620
↓ 6 callersFunctionbbox_overlaps
Calculate overlap between two set of bboxes. FP16 Contributed by https://github.com/open-mmlab/mmdetection/pull/4889 Note: Assume bbo
downstream/detection/mmdet/core/bbox/iou_calculators/iou2d_calculator.py:74
↓ 6 callersFunctionbuild_dataloader
Build PyTorch DataLoader. In distributed training, each GPU/process has a dataloader. In non-distributed training, there is only one dataload
downstream/detection/mmdet/datasets/builder.py:87
↓ 6 callersFunctionbuild_match_cost
Builder of IoU calculator.
downstream/detection/mmdet/core/bbox/match_costs/builder.py:7
↓ 6 callersFunctionbuild_neck
Build neck.
downstream/detection/mmdet/models/builder.py:23
↓ 6 callersFunctioncast_tensor_type
Recursively convert Tensor in inputs from ``src_type`` to ``dst_type``. Args: inputs: Inputs that to be casted. src_type (torch.d
downstream/detection/mmdet/utils/memory.py:12
↓ 6 callersMethodconvert
Multiple with alpha and add beat with clip.
downstream/segmentation/mmseg/datasets/pipelines/transforms.py:891
↓ 6 callersFunctionfilter_scores_and_topk
Filter results using score threshold and topk candidates. Args: scores (Tensor): The scores, shape (num_bboxes, K). score_thr (fl
downstream/detection/mmdet/core/utils/misc.py:119
↓ 6 callersMethodformat_results
Format the results to json (standard format for COCO evaluation). Args: results (list[tuple | numpy.ndarray]): Testing results of
downstream/detection/mmdet/datasets/coco.py:358
↓ 6 callersMethodforward_plugin
Forward function for plugins.
downstream/segmentation/mmseg/models/backbones/resnet.py:245
↓ 6 callersMethodforward_test
Args: imgs (List[Tensor]): the outer list indicates test-time augmentations and inner Tensor should have a shape
downstream/segmentation/mmseg/models/segmentors/base.py:62
↓ 6 callersMethodget_ann_info
Get COCO annotation by index. Args: idx (int): Index of data. Returns: dict: Annotation info of specified in
downstream/detection/mmdet/datasets/coco.py:91
↓ 6 callersMethodmake_block_plugins
make plugins for block. Args: in_channels (int): Input channels of plugin. plugins (list[dict]): List of plugins cfg
downstream/detection/mmdet/models/backbones/resnet.py:219
↓ 6 callersMethodnormalize
(x)
downstream/detection/mmdet/models/dense_heads/autoassign_head.py:288
↓ 6 callersFunctionparse_requirements
Parse the package dependencies listed in a requirements file but strips specific versioning information. Args: fname (str): path to r
downstream/detection/setup.py:56
↓ 6 callersFunctionparse_requirements
Parse the package dependencies listed in a requirements file but strips specific versioning information. Args: fname (str): path to r
downstream/segmentation/setup.py:26
↓ 6 callersMethodshow_result
Show RPN proposals on the image. Args: data (str or np.ndarray): Image filename or loaded image. result (Tensor or tu
downstream/detection/mmdet/models/detectors/rpn.py:142
↓ 6 callersMethodsimple_test_rpn
Simple forward test function.
downstream/detection/mmdet/models/dense_heads/cascade_rpn_head.py:773
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
downstream/detection/mmdet/models/backbones/agent_pvt.py:18
↓ 5 callersMethod__init__
(self, embed_dims, feedforward_channels, act_cfg=dict(type=
downstream/detection/mmdet/models/backbones/pvt.py:47
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
downstream/segmentation/mmseg/models/backbones/agent_pvt.py:18
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
agent_transformer/models/agent_pvt.py:22
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
agent_transformer/models/agent_cswin.py:48
↓ 5 callersMethod_bbox_forward
Box head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/scnet_roi_head.py:96
↓ 5 callersMethod_bbox_forward
Box head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/cascade_roi_head.py:130
↓ 5 callersMethod_freeze_stages
(self)
downstream/detection/mmdet/models/backbones/resnet.py:613
↓ 5 callersMethod_mask_forward
Mask head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/cascade_roi_head.py:158
↓ 5 callersFunctionadd_dummy_nms_for_onnx
Create a dummy onnx::NonMaxSuppression op while exporting to ONNX. This function helps exporting to onnx with batch and multiclass NMS op. It
downstream/detection/mmdet/core/export/onnx_helper.py:82
↓ 5 callersMethodbackward
(ctx, grad_output)
downstream/detection/mmdet/models/utils/misc.py:25
↓ 5 callersFunctionbuild_dataloader
Build PyTorch DataLoader. In distributed training, each GPU/process has a dataloader. In non-distributed training, there is only one dataload
downstream/segmentation/mmseg/datasets/builder.py:90
↓ 5 callersMethodbuild_project
Build projection layer for key/query/value/out.
downstream/segmentation/mmseg/models/utils/self_attention_block.py:100
↓ 5 callersFunctioncorrect_unfold_norm_order
(x)
downstream/detection/mmdet/models/utils/ckpt_convert.py:173
↓ 5 callersFunctioncorrect_unfold_reduction_order
(x)
downstream/detection/mmdet/models/utils/ckpt_convert.py:166
↓ 5 callersMethodevaluate
Evaluate the dataset. Args: results (list[tuple[torch.Tensor]] | list[str]): per image pre_eval results or predi
downstream/segmentation/mmseg/datasets/custom.py:388
↓ 5 callersFunctionexists
(val)
agentsd/patch.py:80
↓ 5 callersMethodextract_feat
Directly extract features from the backbone+neck.
downstream/detection/mmdet/models/detectors/two_stage.py:65
↓ 5 callersFunctiongenerate_coordinate
Generate the coordinate. Args: featmap_sizes (tuple): The feature to be calculated, of shape (N, C, W, H). device (st
downstream/detection/mmdet/core/utils/misc.py:190
↓ 5 callersMethodget_activation
Get custom activation of cls_score. Args: cls_score (torch.Tensor): The prediction with shape (N, C + 2). Returns:
downstream/detection/mmdet/models/losses/seesaw_loss.py:157
↓ 5 callersMethodget_ann_ids
(self, img_ids=[], cat_ids=[], area_rng=[], iscrowd=None)
downstream/detection/mmdet/datasets/api_wrappers/coco_api.py:27
↓ 5 callersMethodget_cat_ids
Get COCO category ids by index. Args: idx (int): Index of data. Returns: list[int]: All categories in the im
downstream/detection/mmdet/datasets/coco.py:106
↓ 5 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
downstream/detection/mmdet/models/utils/make_divisible.py:2
↓ 5 callersFunctionmerge_aug_bboxes
Merge augmented detection bboxes and scores. Args: aug_bboxes (list[Tensor]): shape (n, 4*#class) aug_scores (list[Tensor] or Non
downstream/detection/mmdet/core/post_processing/merge_augs.py:84
↓ 5 callersMethodpre_pipeline
Prepare results dict for pipeline.
downstream/detection/mmdet/datasets/custom.py:167
↓ 5 callersMethodrefine_bboxes
Refine bboxes during training. Args: rois (Tensor): Shape (n*bs, 5), where n is image number per GPU, and bs is t
downstream/detection/mmdet/models/roi_heads/bbox_heads/bbox_head.py:381
↓ 5 callersFunctionto_tensor
Convert objects of various python types to :obj:`torch.Tensor`. Supported types are: :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`S
downstream/detection/mmdet/datasets/pipelines/formatting.py:12
↓ 4 callersMethod__init__
(self, embed_dims, num_heads, window_size,
downstream/detection/mmdet/models/backbones/swin.py:41
↓ 4 callersMethod__init__
(self, linear=False, eps=1e-6, reduction='mean',
downstream/detection/mmdet/models/losses/iou_loss.py:256
↓ 4 callersMethod__init__
(self, backbone_cfg, in_channels=3, spatial_channels=(64, 6
downstream/segmentation/mmseg/models/backbones/bisenetv1.py:294
↓ 4 callersMethod__init__
(self, embed_dims, num_heads, window_size,
downstream/segmentation/mmseg/models/backbones/swin.py:42
↓ 4 callersMethod__init__
(self, depth, in_channels=3, stem_channels=64,
downstream/segmentation/mmseg/models/backbones/resnet.py:396
↓ 4 callersMethod__init__
(self, low_in_channels, high_in_channels, channels, out_channels, query_scales, key_pool_scal
downstream/segmentation/mmseg/models/decode_heads/ann_head.py:100
↓ 4 callersMethod_bbox_forward
Box head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/htc_roi_head.py:158
↓ 4 callersFunction_ignore_torch_cuda_oom
A context which ignores CUDA OOM exception from pytorch. Code is modified from <https://github.com/facebookresearch/detectron2/blob/main/dete
downstream/detection/mmdet/utils/memory.py:63
↓ 4 callersMethod_mask_forward
Mask head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/standard_roi_head.py:181
↓ 4 callersFunctionagentv5_sra_flops
(h, w, r, dim, group_size, downstream_agent_shape, attn_type)
downstream/detection/tools/analysis_tools/get_flops.py:57
↓ 4 callersFunctionagentv5_sra_flops
(h, w, r, dim, group_size, downstream_agent_shape, attn_type)
downstream/segmentation/tools/get_flops.py:39
↓ 4 callersFunctionanchor_ctr_inside_region_flags
Get the flag indicate whether anchor centers are inside regions.
downstream/detection/mmdet/core/bbox/assigners/region_assigner.py:27
↓ 4 callersFunctionbbox_mapping_back
Map bboxes from testing scale to original image scale.
downstream/detection/mmdet/core/bbox/transforms.py:63
↓ 4 callersFunctionbuild_linear_layer
Build linear layer. Args: cfg (None or dict): The linear layer config, which should contain: - type (str): Layer type.
downstream/detection/mmdet/models/utils/builder.py:17
↓ 4 callersFunctioncalc_region
Calculate region of the box defined by the ratio, the ratio is from the center of the box to every edge.
downstream/detection/mmdet/core/bbox/assigners/region_assigner.py:10
↓ 4 callersFunctioncalc_region
Calculate a proportional bbox region. The bbox center are fixed and the new h' and w' is h * ratio and w * ratio. Args: bbox (Tensor
downstream/detection/mmdet/core/anchor/utils.py:50
↓ 4 callersFunctiondynamic_clip_for_onnx
Clip boxes dynamically for onnx. Since torch.clamp cannot have dynamic `min` and `max`, we scale the boxes by 1/max_shape and clamp in the
downstream/detection/mmdet/core/export/onnx_helper.py:7
↓ 4 callersFunctionencode_mask_results
Encode bitmap mask to RLE code. Args: mask_results (list | tuple[list]): bitmap mask results. In mask scoring rcnn, mask_resu
downstream/detection/mmdet/core/mask/utils.py:38
↓ 4 callersFunctioneval_map
Evaluate mAP of a dataset. Args: det_results (list[list]): [[cls1_det, cls2_det, ...], ...]. The outer list indicates images,
downstream/detection/mmdet/core/evaluation/mean_ap.py:525
↓ 4 callersFunctioneval_metrics
Calculate evaluation metrics Args: results (list[ndarray] | list[str]): List of prediction segmentation maps or list of predic
downstream/segmentation/mmseg/core/evaluation/metrics.py:257
↓ 4 callersMethodextract_feat
Directly extract features from the backbone+neck.
downstream/detection/mmdet/models/detectors/single_stage.py:41
↓ 4 callersMethodextract_feats
Extract features from multiple images. Args: imgs (list[torch.Tensor]): A list of images. The images are augmente
downstream/detection/mmdet/models/detectors/base.py:50
↓ 4 callersFunctionget_class_weight
Get class weight for loss function. Args: class_weight (list[float] | str | None): If class_weight is a str, take it as a fil
downstream/segmentation/mmseg/models/losses/utils.py:10
↓ 4 callersMethodget_extra_property
Get user-defined property.
downstream/detection/mmdet/core/bbox/assigners/assign_result.py:61
↓ 4 callersMethodget_img_ids
(self, img_ids=[], cat_ids=[])
downstream/detection/mmdet/datasets/api_wrappers/coco_api.py:33
↓ 4 callersFunctionget_k_for_topk
Get k of TopK for onnx exporting. The K of TopK in TensorRT should not be a Tensor, while in ONNX Runtime it could be a Tensor.Due to dynam
downstream/detection/mmdet/core/export/onnx_helper.py:46
↓ 4 callersMethodget_zipfile
(path)
agent_transformer/data/zipreader.py:31
↓ 4 callersMethodload_anns
Load anns with the specified ids. self.anns is a list of annotation lists instead of a list of annotations. Args:
downstream/detection/mmdet/datasets/coco_panoptic.py:89
↓ 4 callersMethodload_imgs
(self, ids)
downstream/detection/mmdet/datasets/api_wrappers/coco_api.py:42
↓ 4 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
downstream/segmentation/mmseg/models/utils/make_divisible.py:2
↓ 4 callersMethodmake_stage_plugins
Make plugins for ResNet ``stage_idx`` th stage. Currently we support to insert ``context_block``, ``empirical_attention_block``, ``no
downstream/detection/mmdet/models/backbones/resnet.py:494
↓ 4 callersMethodmlu
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:277
↓ 4 callersFunctionnlc_to_nchw
Convert [N, L, C] shape tensor to [N, C, H, W] shape tensor. Args: x (Tensor): The input tensor of shape [N, L, C] before conversion.
downstream/detection/mmdet/models/utils/transformer.py:32
↓ 4 callersFunctionnlc_to_nchw
Convert [N, L, C] shape tensor to [N, C, H, W] shape tensor. Args: x (Tensor): The input tensor of shape [N, L, C] before conversion.
downstream/segmentation/mmseg/models/utils/shape_convert.py:2
↓ 4 callersMethodpoints2bbox
Converting the points set into bounding box. :param pts: the input points sets (fields), each points set (fields) is represented
downstream/detection/mmdet/models/dense_heads/reppoints_head.py:170
↓ 4 callersMethodpre_pipeline
Prepare results dict for pipeline.
downstream/segmentation/mmseg/datasets/custom.py:193
↓ 4 callersMethodprepare_train_img
Get training data and annotations after pipeline. Args: idx (int): Index of data. Returns: dict: Training da
downstream/detection/mmdet/datasets/custom.py:224
↓ 4 callersFunctionpreprocess_example_input
Prepare an example input image for ``generate_inputs_and_wrap_model``. Args: input_config (dict): customized config describing the exampl
downstream/detection/mmdet/core/export/pytorch2onnx.py:102
↓ 4 callersMethodresize_feats
Downsample the first feat and upsample last feat in feats.
downstream/detection/mmdet/models/dense_heads/solo_head.py:133
↓ 4 callersMethodresults2json
Dump the detection results to a COCO style json file. There are 3 types of results: proposals, bbox predictions, mask predictions, an
downstream/detection/mmdet/datasets/coco.py:294
↓ 4 callersMethodside_aware_split
Split side-aware features aligned with orders of bucketing targets.
downstream/detection/mmdet/models/roi_heads/bbox_heads/sabl_head.py:289
↓ 4 callersFunctionsingle_gpu_test
(model, data_loader, show=False, out_dir=None,
downstream/detection/mmdet/apis/test.py:17
↓ 4 callersMethodsplit_zip_style_path
(path)
agent_transformer/data/zipreader.py:39
↓ 4 callersFunctionsra_flops
(h, w, r, dim, stage)
downstream/detection/tools/analysis_tools/get_flops.py:48
↓ 4 callersFunctionsra_flops
(h, w, r, dim, stage)
downstream/segmentation/tools/get_flops.py:30
↓ 4 callersFunctionsync_random_seed
Make sure different ranks share the same seed. All workers must call this function, otherwise it will deadlock. This method is generally used
downstream/detection/mmdet/core/utils/dist_utils.py:157
↓ 4 callersFunctionto_tensor
Convert objects of various python types to :obj:`torch.Tensor`. Supported types are: :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`S
downstream/segmentation/mmseg/datasets/pipelines/formatting.py:12
← previousnext →101–200 of 3,501, ranked by callers