MCPcopy Create free account

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

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

↓ 482 callersMethodcat
Concat the predictions of all :obj:`InstanceData` in the list. Args: instances_list (list[:obj:`InstanceData`]): A list
downstream/detection/mmdet/core/data_structures/instance_data.py:151
↓ 340 callersMethodget
(self, *args)
downstream/detection/mmdet/core/data_structures/general_data.py:231
↓ 126 callersMethoditems
(self)
downstream/detection/mmdet/core/data_structures/general_data.py:187
↓ 115 callersMethodinfo
dict: a dictionary of info about the object
downstream/detection/mmdet/core/bbox/assigners/assign_result.py:66
↓ 91 callersMethoddetach
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:297
↓ 83 callersMethodpop
(self, *args)
downstream/detection/mmdet/core/data_structures/general_data.py:235
↓ 83 callersMethodto
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:257
↓ 81 callersMethodcpu
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:267
↓ 79 callersMethodexpand
See :func:`BaseInstanceMasks.expand`.
downstream/detection/mmdet/core/mask/structures.py:369
↓ 73 callersFunctionmulti_apply
Apply function to a list of arguments. Note: This function applies the ``func`` to multiple inputs and map the multiple outputs o
downstream/detection/mmdet/core/utils/misc.py:11
↓ 64 callersFunctionbuild_loss
Build loss.
downstream/detection/mmdet/models/builder.py:43
↓ 60 callersMethoddecode
Decode the predicted bboxes according to prediction and base boxes.
downstream/detection/mmdet/core/bbox/coder/base_bbox_coder.py:16
↓ 60 callersMethodnumpy
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:307
↓ 56 callersFunctionimages_to_levels
Convert targets by image to targets by feature level. [target_img0, target_img1] -> [target_level0, target_level1, ...]
downstream/detection/mmdet/core/anchor/utils.py:5
↓ 52 callersMethodkeys
Returns: list: Contains all keys in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:159
↓ 49 callersFunctionbbox2roi
Convert a list of bboxes to roi format. Args: bbox_list (list[Tensor]): a list of bboxes corresponding to a batch of images.
downstream/detection/mmdet/core/bbox/transforms.py:75
↓ 47 callersFunctionresize
(input, size=None, scale_factor=None, mode='nearest', align_corner
downstream/segmentation/mmseg/ops/wrappers.py:8
↓ 45 callersFunctionunmap
Unmap a subset of item (data) back to the original set of items (of size count)
downstream/detection/mmdet/core/utils/misc.py:33
↓ 36 callersFunction_cfg
(url='', **kwargs)
agent_transformer/models/deit.py:43
↓ 35 callersMethodimread
(path)
agent_transformer/data/zipreader.py:93
↓ 33 callersFunction_create_vision_transformer
(variant, pretrained=False, default_cfg=None, **kwargs)
agent_transformer/models/deit.py:516
↓ 32 callersFunction_cfg
(url='', **kwargs)
agent_transformer/models/agent_deit.py:51
↓ 30 callersFunction_n2p
(w, t=True)
agent_transformer/models/agent_deit.py:478
↓ 30 callersFunction_n2p
(w, t=True)
agent_transformer/models/deit.py:401
↓ 27 callersMethod_transform_inputs
Transform inputs for decoder. Args: inputs (list[Tensor]): List of multi-level img features. Returns: Tensor
downstream/segmentation/mmseg/models/decode_heads/decode_head.py:183
↓ 26 callersMethodcls_seg
Classify each pixel with fc.
downstream/segmentation/mmseg/models/decode_heads/point_head.py:116
↓ 26 callersMethodto
Change the device of the data inplace. Example: >>> self = SamplingResult.random() >>> print(f'self = {self.to(None)}
downstream/detection/mmdet/core/bbox/samplers/sampling_result.py:57
↓ 25 callersFunctionbuild_head
Build head.
downstream/detection/mmdet/models/builder.py:38
↓ 25 callersMethodcuda
Apply same name function to all tensors in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:287
↓ 25 callersMethodpad
See :func:`BaseInstanceMasks.pad`.
downstream/detection/mmdet/core/mask/structures.py:303
↓ 25 callersFunctionreduce_mean
Obtain the mean of tensor on different GPUs.
downstream/detection/mmdet/core/utils/dist_utils.py:68
↓ 25 callersMethodsample
Sample positive and negative bboxes. This is a simple implementation of bbox sampling given candidates, assigning results and ground
downstream/detection/mmdet/core/bbox/samplers/base_sampler.py:35
↓ 24 callersMethodassign
Assign gt to bboxes. The assignment is done in following steps 1. compute iou between all bbox (bbox of all pyramid levels) and gt
downstream/detection/mmdet/core/bbox/assigners/atss_assigner.py:52
↓ 24 callersFunctionbbox_overlaps
Calculate the ious between each bbox of bboxes1 and bboxes2. Args: bboxes1 (ndarray): Shape (n, 4) bboxes2 (ndarray): Shape (k, 4
downstream/detection/mmdet/core/evaluation/bbox_overlaps.py:5
↓ 23 callersMethodextract_feat
Extract features. Args: img (torch.Tensor): Image tensor with shape (n, c, h ,w). Returns: list[torch.Tensor
downstream/detection/mmdet/models/detectors/rpn.py:39
↓ 22 callersFunctionbuild_assigner
Builder of box assigner.
downstream/detection/mmdet/core/bbox/builder.py:9
↓ 21 callersFunctionbuild_sampler
Builder of box sampler.
downstream/detection/mmdet/core/bbox/builder.py:14
↓ 21 callersMethodnorm1
nn.Module: the normalization layer named "norm1"
downstream/detection/mmdet/models/backbones/hrnet.py:403
↓ 20 callersFunctionbbox2result
Convert detection results to a list of numpy arrays. Args: bboxes (torch.Tensor | np.ndarray): shape (n, 5) labels (torch.Tensor
downstream/detection/mmdet/core/bbox/transforms.py:116
↓ 18 callersMethodflip
See :func:`BaseInstanceMasks.flip`.
downstream/detection/mmdet/core/mask/structures.py:290
↓ 18 callersMethodgrid_priors
Generate grid anchors in multiple feature levels. Args: featmap_sizes (list[tuple]): List of feature map sizes in
downstream/detection/mmdet/core/anchor/anchor_generator.py:216
↓ 18 callersMethodloss
Loss function of DIIHead, get loss of all images. Args: cls_score (Tensor): Classification prediction results of
downstream/detection/mmdet/models/roi_heads/bbox_heads/dii_head.py:201
↓ 17 callersMethodencode
Encode deltas between bboxes and ground truth boxes.
downstream/detection/mmdet/core/bbox/coder/base_bbox_coder.py:12
↓ 17 callersMethodget_anchors
Get anchors according to feature map sizes. Args: featmap_sizes (list[tuple]): Multi-level feature map sizes. img_met
downstream/detection/mmdet/models/dense_heads/vfnet_head.py:568
↓ 17 callersMethodvalues
Returns: list: Contains all values in data_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:173
↓ 15 callersMethodforward_plugin
(self, x, plugin_names)
downstream/detection/mmdet/models/backbones/resnet.py:242
↓ 15 callersMethodget_targets
Calculate the ground truth for all samples in a batch according to the sampling_results. Almost the same as the implementation in bbo
downstream/detection/mmdet/models/roi_heads/bbox_heads/dii_head.py:359
↓ 15 callersMethodnorm2
nn.Module: the normalization layer named "norm2"
downstream/detection/mmdet/models/backbones/hrnet.py:408
↓ 14 callersFunctiondigit_version
Convert a version string into a tuple of integers. This method is usually used for comparing two versions. For pre-release versions: alpha <
downstream/segmentation/mmseg/__init__.py:13
↓ 13 callersFunctionbuild_dataset
(cfg, default_args=None)
downstream/detection/mmdet/datasets/builder.py:59
↓ 13 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
downstream/segmentation/mmseg/utils/logger.py:7
↓ 13 callersMethodget_seg_masks
Get segmentation masks from mask_pred and bboxes. Args: mask_pred (Tensor or ndarray): shape (n, #class, h, w). F
downstream/detection/mmdet/models/roi_heads/mask_heads/fcn_mask_head.py:179
↓ 13 callersFunctionload_checkpoint
(config, model, optimizer, lr_scheduler, logger)
agent_transformer/utils.py:13
↓ 13 callersMethodnew
Return a new results with same image meta information. Args: meta_info (dict, optional): A dict contains the meta information
downstream/detection/mmdet/core/data_structures/general_data.py:141
↓ 13 callersFunctionweight_reduce_loss
Apply element-wise weight and reduce loss. Args: loss (Tensor): Element-wise loss. weight (Tensor): Element-wise weights.
downstream/detection/mmdet/models/losses/utils.py:30
↓ 12 callersFunction_print
(result, ap=1, iouThr=None, areaRng='all', maxDets=100)
downstream/detection/tools/analysis_tools/robustness_eval.py:11
↓ 12 callersFunctiondigit_version
(version_str)
downstream/detection/mmdet/__init__.py:7
↓ 12 callersFunctionfloordiv
(dividend, divisor, rounding_mode='trunc')
downstream/detection/mmdet/utils/misc.py:85
↓ 12 callersFunctionget_root_logger
Get root logger. Args: log_file (str, optional): File path of log. Defaults to None. log_level (int, optional): The level of logg
downstream/detection/mmdet/utils/logger.py:8
↓ 12 callersMethodread
(path)
agent_transformer/data/zipreader.py:86
↓ 11 callersMethod_mask_forward
Mask head forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/scnet_roi_head.py:125
↓ 11 callersFunctionbbox_mapping
Map bboxes from the original image scale to testing scale.
downstream/detection/mmdet/core/bbox/transforms.py:51
↓ 11 callersMethodget_bboxes
(self, det_bboxes, grid_pred, img_metas)
downstream/detection/mmdet/models/roi_heads/mask_heads/grid_head.py:298
↓ 11 callersFunctionlevels_to_images
Concat multi-level feature maps by image. [feature_level0, feature_level1...] -> [feature_image0, feature_image1...] Convert the shape of eac
downstream/detection/mmdet/models/dense_heads/paa_head.py:18
↓ 11 callersFunctionmulticlass_nms
NMS for multi-class bboxes. Args: multi_bboxes (Tensor): shape (n, #class*4) or (n, 4) multi_scores (Tensor): shape (n, #class),
downstream/detection/mmdet/core/post_processing/bbox_nms.py:8
↓ 10 callersMethod_make_layers
Initialize conv sequential for CornerHead.
downstream/detection/mmdet/models/dense_heads/corner_head.py:158
↓ 10 callersFunctionbbox_xyxy_to_cxcywh
Convert bbox coordinates from (x1, y1, x2, y2) to (cx, cy, w, h). Args: bbox (Tensor): Shape (n, 4) for bboxes. Returns: Ten
downstream/detection/mmdet/core/bbox/transforms.py:259
↓ 10 callersMethodevaluate
Evaluate in VOC protocol. Args: results (list[list | tuple]): Testing results of the dataset. metric (str | list[str]
downstream/detection/mmdet/datasets/voc.py:34
↓ 10 callersMethodget_targets
Get targets for PAA head. This method is almost the same as `AnchorHead.get_targets()`. We direct return the results from _get_target
downstream/detection/mmdet/models/dense_heads/paa_head.py:402
↓ 10 callersMethodrandom_choice
Random select some elements from the gallery. If `gallery` is a Tensor, the returned indices will be a Tensor; If `gallery` is a ndar
downstream/detection/mmdet/core/bbox/samplers/random_sampler.py:32
↓ 9 callersMethod__init__
( self, in_channels=3, embed_dims=768, conv_type='Conv2d', kernel_size
downstream/detection/mmdet/models/utils/transformer.py:162
↓ 9 callersMethod_bbox_forward
Box forward function used in both training and testing.
downstream/detection/mmdet/models/roi_heads/pisa_roi_head.py:87
↓ 9 callersFunctionaccuracy
Calculate accuracy according to the prediction and target. Args: pred (torch.Tensor): The model prediction, shape (N, num_class)
downstream/detection/mmdet/models/losses/accuracy.py:7
↓ 9 callersFunctionanchor_inside_flags
Check whether the anchors are inside the border. Args: flat_anchors (torch.Tensor): Flatten anchors, shape (n, 4). valid_flags (t
downstream/detection/mmdet/core/anchor/utils.py:21
↓ 9 callersFunctionbbox_cxcywh_to_xyxy
Convert bbox coordinates from (cx, cy, w, h) to (x1, y1, x2, y2). Args: bbox (Tensor): Shape (n, 4) for bboxes. Returns: Ten
downstream/detection/mmdet/core/bbox/transforms.py:245
↓ 9 callersFunctionbuild_bbox_coder
Builder of box coder.
downstream/detection/mmdet/core/bbox/builder.py:19
↓ 9 callersFunctionbuild_dataset
Build datasets.
downstream/segmentation/mmseg/datasets/builder.py:67
↓ 9 callersFunctionbuild_prior_generator
(cfg, default_args=None)
downstream/detection/mmdet/core/anchor/builder.py:11
↓ 9 callersFunctionreplace_cfg_vals
Replace the string "${key}" with the corresponding value. Replace the "${key}" with the value of ori_cfg.key in the config. And support repla
downstream/detection/mmdet/utils/replace_cfg_vals.py:7
↓ 9 callersFunctionupdate_data_root
Update data root according to env MMDET_DATASETS. If set env MMDET_DATASETS, update cfg.data_root according to MMDET_DATASETS. Otherwise, usi
downstream/detection/mmdet/utils/misc.py:46
↓ 9 callersFunctionwmsa_adv5_flops
(h, w, dim, group_size, downstream_agent_shape, attn_type)
downstream/detection/tools/analysis_tools/get_flops.py:101
↓ 9 callersFunctionwmsa_adv5_flops
(h, w, dim, group_size, downstream_agent_shape, attn_type)
downstream/segmentation/tools/get_flops.py:83
↓ 8 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
agent_transformer/models/agent_swin.py:20
↓ 8 callersFunctionadd_prefix
Add prefix for dict. Args: inputs (dict): The input dict with str keys. prefix (str): The prefix to add. Returns: d
downstream/segmentation/mmseg/core/utils/misc.py:2
↓ 8 callersFunctionbuild_detector
Build detector.
downstream/detection/mmdet/models/builder.py:48
↓ 8 callersFunctionbuild_roi_extractor
Build roi extractor.
downstream/detection/mmdet/models/builder.py:28
↓ 8 callersFunctionimshow_det_bboxes
Draw bboxes and class labels (with scores) on an image. Args: img (str | ndarray): The image to be displayed. bboxes (ndarray): B
downstream/detection/mmdet/core/visualization/image.py:208
↓ 8 callersMethodnorm1
(self)
downstream/segmentation/mmseg/models/backbones/beit.py:385
↓ 8 callersFunctionreplace_ImageToTensor
Replace the ImageToTensor transform in a data pipeline to DefaultFormatBundle, which is normally useful in batch inference. Args: pip
downstream/detection/mmdet/datasets/utils.py:15
↓ 8 callersFunctionselect_single_mlvl
Extract a multi-scale single image tensor from a multi-scale batch tensor based on batch index. Note: The default value of detach is True, be
downstream/detection/mmdet/core/utils/misc.py:88
↓ 8 callersFunctiontranspose_and_gather_feat
Transpose and gather feature according to index. Args: feat (Tensor): Target feature map. ind (Tensor): Target coord index.
downstream/detection/mmdet/models/utils/gaussian_target.py:255
↓ 7 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
downstream/detection/mmdet/models/backbones/agent_swin.py:23
↓ 7 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
downstream/segmentation/mmseg/models/backbones/agent_swin.py:23
↓ 7 callersFunctionbuild_backbone
Build backbone.
downstream/detection/mmdet/models/builder.py:18
↓ 7 callersFunctionbuild_iou_calculator
Builder of IoU calculator.
downstream/detection/mmdet/core/bbox/iou_calculators/builder.py:7
↓ 7 callersFunctionbuild_segmentor
Build segmentor.
downstream/segmentation/mmseg/models/builder.py:38
↓ 7 callersMethodbuild_trans
(self, cfg, in_channels, out_channels, **extra_args)
downstream/detection/mmdet/models/necks/fpg.py:317
↓ 7 callersMethodget_bboxes
(self, cls_scores, bbox_preds, score_factors=None,
downstream/detection/mmdet/models/dense_heads/paa_head.py:521
↓ 7 callersMethodloss
Compute losses of the head. Args: cls_scores (list[Tensor]): Cls and quality scores for each scale level has shap
downstream/detection/mmdet/models/dense_heads/ld_head.py:185
↓ 7 callersFunctionmerge_aug_masks
Merge augmented mask prediction. Args: aug_masks (list[ndarray]): shape (n, #class, h, w) img_shapes (list[ndarray]): shape (3, )
downstream/detection/mmdet/core/post_processing/merge_augs.py:121
next →1–100 of 3,501, ranked by callers