MCPcopy Create free account

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

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

↓ 2 callersFunctioncenter_of_mass
Calculate the centroid coordinates of the mask. Args: mask (Tensor): The mask to be calculated, shape (h, w). esp (float): Avoid
downstream/detection/mmdet/core/utils/misc.py:168
↓ 2 callersMethodcenterness_target
(self, anchors, gts)
downstream/detection/mmdet/models/dense_heads/atss_head.py:305
↓ 2 callersFunctionclip_big_image
(image_path, clip_save_dir, to_label=False)
downstream/segmentation/tools/convert_datasets/vaihingen.py:34
↓ 2 callersFunctionclip_big_image
(image_path, clip_save_dir, args, to_label=False)
downstream/segmentation/tools/convert_datasets/potsdam.py:34
↓ 2 callersFunctioncollect_env
Collect the information of the running environments.
downstream/detection/mmdet/utils/collect_env.py:8
↓ 2 callersFunctioncollect_env
Collect the information of the running environments.
downstream/segmentation/mmseg/utils/collect_env.py:8
↓ 2 callersFunctioncollect_results_gpu
(result_part, size)
downstream/detection/mmdet/apis/test.py:179
↓ 2 callersFunctioncompute_merge
(x: torch.Tensor, tome_info: Dict[str, Any])
agentsd/patch.py:12
↓ 2 callersMethodcontrast
Contrast distortion.
downstream/segmentation/mmseg/datasets/pipelines/transforms.py:906
↓ 2 callersFunctioncreate_logger
(output_dir, dist_rank=0, name='')
agent_transformer/logger.py:16
↓ 2 callersMethodcrop
See :func:`BaseInstanceMasks.crop`.
downstream/detection/mmdet/core/mask/structures.py:314
↓ 2 callersMethodcrop
Crop predicted masks by zeroing out everything not in the predicted bbox. Args: masks (Tensor): shape [H, W, N].
downstream/detection/mmdet/models/dense_heads/yolact_head.py:876
↓ 2 callersFunctioncvt_annotations
(devkit_path, years, split, out_file)
downstream/detection/tools/dataset_converters/pascal_voc.py:68
↓ 2 callersFunctiondefault
(val, d)
agentsd/patch.py:84
↓ 2 callersMethoddetection_evaluate
Evaluation for object detection. Args: dataset (Dataset): A PyTorch dataset. results (list): Object detection results
downstream/detection/tools/analysis_tools/analyze_results.py:184
↓ 2 callersFunctiondigit_version
(version_str)
downstream/segmentation/tools/pytorch2torchscript.py:17
↓ 2 callersFunctiondistance2bbox
Decode distance prediction to bounding box. Args: points (Tensor): Shape (B, N, 2) or (N, 2). distance (Tensor): Distance from th
downstream/detection/mmdet/core/bbox/transforms.py:136
↓ 2 callersFunctiondownload_one
(url, dir)
downstream/detection/tools/misc/download_dataset.py:37
↓ 2 callersFunctiondraw_labels
Draw labels on the axes. Args: ax (matplotlib.Axes): The input axes. labels (ndarray): The labels with the shape of (n, ).
downstream/detection/mmdet/core/visualization/image.py:114
↓ 2 callersMethodevaluate_det_segm
Instance segmentation and object detection evaluation in COCO protocol. Args: results (list[list | tuple | dict]): Testin
downstream/detection/mmdet/datasets/coco.py:386
↓ 2 callersMethodextract_feat
Directly extract features from the backbone and neck.
downstream/detection/mmdet/models/detectors/single_stage_instance_seg.py:56
↓ 2 callersMethodextract_feat
Extract features from images.
downstream/segmentation/mmseg/models/segmentors/encoder_decoder.py:64
↓ 2 callersMethodfast_eval_recall
(self, results, proposal_nums, iou_thrs, logger=None)
downstream/detection/mmdet/datasets/coco.py:334
↓ 2 callersFunctionflatten_binary_logits
Flattens predictions in the batch (binary case) Remove labels equal to 'ignore_index'.
downstream/segmentation/mmseg/models/losses/lovasz_loss.py:30
↓ 2 callersFunctionflatten_probs
Flattens predictions in the batch.
downstream/segmentation/mmseg/models/losses/lovasz_loss.py:43
↓ 2 callersFunctionflip_tensor
flip tensor base on flip_direction. Args: src_tensor (Tensor): input feature map, shape (B, C, H, W). flip_direction (str): The f
downstream/detection/mmdet/core/utils/misc.py:65
↓ 2 callersMethodformat_results
Format the results into dir (standard format for ade20k evaluation). Args: results (list): Testing results of the dataset.
downstream/segmentation/mmseg/datasets/ade.py:135
↓ 2 callersMethodforward
Placeholder of forward function. Returns: dict[str, Tensor]: A dictionary, including features and predicted score
downstream/detection/mmdet/models/seg_heads/base_semantic_head.py:55
↓ 2 callersMethodforward
Forward features from the upstream network. Args: feats (tuple[Tensor]): Features from the upstream network, each is
downstream/detection/mmdet/models/dense_heads/ssd_head.py:196
↓ 2 callersMethodforward
Args: x (Tensor): Has shape (B, C, H, W). In most case, C is 3. Returns: tuple: Contains merged results and
downstream/detection/mmdet/models/utils/transformer.py:236
↓ 2 callersMethodforward
(self, fine_grained_point_feats, coarse_point_feats)
downstream/segmentation/mmseg/models/decode_heads/point_head.py:123
↓ 2 callersMethodforward
Forward function.
downstream/segmentation/mmseg/models/decode_heads/enc_head.py:130
↓ 2 callersMethodforward
Placeholder of forward function.
downstream/segmentation/mmseg/models/decode_heads/cascade_decode_head.py:15
↓ 2 callersMethodforward_head
Forward for head part which is called after every decoder layer. Args: decoder_out (Tensor): in shape (num_queries, batch_size, c
downstream/detection/mmdet/models/dense_heads/mask2former_head.py:309
↓ 2 callersFunctiongaussian_radius
r"""Generate 2D gaussian radius. This function is modified from the `official github repo <https://github.com/princeton-vl/CornerNet-Lite/blo
downstream/detection/mmdet/models/utils/gaussian_target.py:68
↓ 2 callersMethodgen_base_anchors
Generate base anchors. Returns: list(torch.Tensor): Base anchors of a feature grid in multiple \ feature levels.
downstream/detection/mmdet/core/anchor/anchor_generator.py:131
↓ 2 callersMethodgen_grid_from_reg
Base on the previous bboxes and regression values, we compute the regressed bboxes and generate the grids on the bboxes. :param reg:
downstream/detection/mmdet/models/dense_heads/reppoints_head.py:221
↓ 2 callersMethodgen_single_level_base_anchors
Generate base anchors of a single level. Args: base_size (int | float): Basic size of an anchor. scales (torch.Tensor
downstream/detection/mmdet/core/anchor/anchor_generator.py:151
↓ 2 callersFunctiongenerate_aug_list
(merged_list, excluded_list)
downstream/segmentation/tools/convert_datasets/voc_aug.py:21
↓ 2 callersMethodget_anchors
Get squares according to feature map sizes and guided anchors. Args: featmap_sizes (list[tuple]): Multi-level feature map sizes.
downstream/detection/mmdet/models/dense_heads/guided_anchor_head.py:299
↓ 2 callersMethodget_anchors
Get squares according to feature map sizes and guided anchors. Args: featmap_sizes (list[tuple]): Multi-level feature map sizes.
downstream/detection/mmdet/models/dense_heads/sabl_retina_head.py:210
↓ 2 callersMethodget_ann_info
Get annotation of concatenated dataset by index. Args: idx (int): Index of data. Returns: dict: Annotation i
downstream/detection/mmdet/datasets/dataset_wrappers.py:72
↓ 2 callersMethodget_ann_info
Get OpenImages annotation by index. Args: idx (int): Index of data. Returns: dict: Annotation info of specif
downstream/detection/mmdet/datasets/openimages.py:220
↓ 2 callersMethodget_bboxes
(self)
downstream/detection/mmdet/core/mask/structures.py:532
↓ 2 callersMethodget_bboxes
get_bboxes() is implemented in StageCascadeRPNHead.
downstream/detection/mmdet/models/dense_heads/cascade_rpn_head.py:724
↓ 2 callersFunctionget_classes
Get class names of a dataset.
downstream/detection/mmdet/core/evaluation/class_names.py:318
↓ 2 callersMethodget_classes_from_csv
Get classes name from file. Args: label_file (str): File path of the label description file that maps the classes
downstream/detection/mmdet/datasets/openimages.py:127
↓ 2 callersMethodget_cls_channels
Get custom classification channels. Args: num_classes (int): The number of classes. Returns: int: The custom
downstream/detection/mmdet/models/losses/seesaw_loss.py:145
↓ 2 callersFunctionget_cls_group_ofs
Get `gt_group_of` of a certain class, which is used in Open Images. Args: annotations (list[dict]): Same as `eval_map()`. class_i
downstream/detection/mmdet/core/evaluation/mean_ap.py:504
↓ 2 callersMethodget_crop_bbox
Randomly get a crop bounding box.
downstream/segmentation/mmseg/datasets/pipelines/transforms.py:599
↓ 2 callersMethodget_dataset_idx_and_sample_idx
Return dataset and sample index when given an indice of ConcatDataset. Args: indice (int): indice of sample in ConcatData
downstream/segmentation/mmseg/datasets/dataset_wrappers.py:106
↓ 2 callersFunctionget_grad_norm
(parameters, norm_type=2)
agent_transformer/utils.py:216
↓ 2 callersFunctionget_grad_norm
(parameters, norm_type=2)
agent_transformer/utils_ema.py:242
↓ 2 callersMethodget_gt_seg_maps
Get ground truth segmentation maps for evaluation.
downstream/segmentation/mmseg/datasets/custom.py:262
↓ 2 callersFunctionget_loading_pipeline
Only keep loading image and annotations related configuration. Args: pipeline (list[dict]): Data pipeline configs. Returns:
downstream/detection/mmdet/datasets/utils.py:75
↓ 2 callersMethodget_meta_from_pipeline
Get image metas from pipeline.
downstream/detection/mmdet/datasets/openimages.py:308
↓ 2 callersMethodget_pad_shape
(self, input_shape)
downstream/detection/mmdet/models/utils/transformer.py:109
↓ 2 callersMethodget_pad_shape
(self, input_shape)
downstream/segmentation/mmseg/models/utils/embed.py:58
↓ 2 callersMethodget_points
Get points according to feature map sizes. Args: featmap_sizes (list[tuple]): Multi-level feature map sizes. img_meta
downstream/detection/mmdet/models/dense_heads/reppoints_head.py:304
↓ 2 callersMethodget_relation_matrix
Get hierarchy for classes. Args: hierarchy_file (sty): File path to the hierarchy for classes. Returns: ndar
downstream/detection/mmdet/datasets/openimages.py:357
↓ 2 callersMethodget_roi_rel_points_test
Get ``num_points`` most uncertain points during test. Args: mask_pred (Tensor): A tensor of shape (num_rois, num_classes,
downstream/detection/mmdet/models/roi_heads/mask_heads/mask_point_head.py:215
↓ 2 callersMethodget_sampled_approxs
Get sampled approxs and inside flags according to feature map sizes. Args: featmap_sizes (list[tuple]): Multi-level feature map s
downstream/detection/mmdet/models/dense_heads/guided_anchor_head.py:249
↓ 2 callersMethodget_targets
Compute corresponding GT box and classification targets for proposals. Args: proposals_list (list[list]): Multi level poi
downstream/detection/mmdet/models/dense_heads/reppoints_head.py:442
↓ 2 callersMethodget_targets
Compute semantic segmentation targets for each image. Args: segm_pred (Tensor): Predicted semantic segmentation map
downstream/detection/mmdet/models/dense_heads/yolact_head.py:542
↓ 2 callersFunctionget_uncertain_point_coords_with_randomness
Get ``num_points`` most uncertain points with random points during train. Sample points in [0, 1] x [0, 1] coordinate space based on their
downstream/detection/mmdet/models/utils/point_sample.py:32
↓ 2 callersFunctionget_uncertainty
Estimate uncertainty based on pred logits. We estimate uncertainty as L1 distance between 0.0 and the logits prediction in 'mask_pred' for th
downstream/detection/mmdet/models/utils/point_sample.py:6
↓ 2 callersMethodget_zero_center_bbox_tensor
Get a tensor of bboxes centered at (0, 0). Returns: Tensor: Tensor of bboxes with shape (num_bboxes, 4) in [xmin, ymi
downstream/detection/tools/analysis_tools/optimize_anchors.py:124
↓ 2 callersMethodhard_mining
(self, inds, num_expected, bboxes, labels, feats)
downstream/detection/mmdet/core/bbox/samplers/ohem_sampler.py:34
↓ 2 callersMethodim2cswin
(self, x)
agent_transformer/models/agent_cswin.py:94
↓ 2 callersMethodim2cswin
(self, x)
agent_transformer/models/agent_cswin.py:191
↓ 2 callersFunctionimg2windows
img: B C H W
agent_transformer/models/agent_cswin.py:353
↓ 2 callersFunctioninference_detector
Inference image(s) with the detector. Args: model (nn.Module): The loaded detector. imgs (str/ndarray or list[str/ndarray] or tup
downstream/detection/mmdet/apis/inference.py:93
↓ 2 callersFunctioninference_segmentor
Inference image(s) with the segmentor. Args: model (nn.Module): The loaded segmentor. imgs (str/ndarray or list[str/ndarray]): Ei
downstream/segmentation/mmseg/apis/inference.py:70
↓ 2 callersFunctioninit_detector
Initialize a detector from config file. Args: config (str, :obj:`Path`, or :obj:`mmcv.Config`): Config file path, :obj:`Path`
downstream/detection/mmdet/apis/inference.py:18
↓ 2 callersFunctioninit_generator
Forks the current default random generator given device.
agentsd/utils.py:19
↓ 2 callersFunctionintersect_and_union
Calculate intersection and Union. Args: pred_label (ndarray | str): Prediction segmentation map or predict result filename.
downstream/segmentation/mmseg/core/evaluation/metrics.py:26
↓ 2 callersFunctionis_located_in
Are points located in bboxes. Args: points (Tensor): Points, shape: (m, 2). bboxes (Tensor): Bounding boxes, shape: (n, 4). Retu
downstream/detection/mmdet/core/bbox/assigners/center_region_assigner.py:37
↓ 2 callersMethodkmeans_maximization
Maximization part of EM algorithm(Expectation-Maximization)
downstream/detection/tools/analysis_tools/optimize_anchors.py:206
↓ 2 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/yolof_head.py:15
↓ 2 callersMethodload_annotations
Load annotation from annotation file.
downstream/detection/mmdet/datasets/custom.py:135
↓ 2 callersMethodload_image_label_from_csv
Load image level annotations from csv style ann_file. Args: image_level_ann_file (str): CSV style image level annotation
downstream/detection/mmdet/datasets/openimages.py:503
↓ 2 callersMethodload_proposals
Load proposal from proposal file.
downstream/detection/mmdet/datasets/custom.py:139
↓ 2 callersFunctionlovasz_grad
Computes gradient of the Lovasz extension w.r.t sorted errors. See Alg. 1 in paper.
downstream/segmentation/mmseg/models/losses/lovasz_loss.py:15
↓ 2 callersFunctionlovasz_hinge_flat
Binary Lovasz hinge loss. Args: logits (torch.Tensor): [P], logits at each prediction (between -infty and +infty). la
downstream/segmentation/mmseg/models/losses/lovasz_loss.py:60
↓ 2 callersFunctionlovasz_softmax_flat
Multi-class Lovasz-Softmax loss. Args: probs (torch.Tensor): [P, C], class probabilities at each prediction (between 0 and 1)
downstream/segmentation/mmseg/models/losses/lovasz_loss.py:129
↓ 2 callersFunctionmake_agent_attn
This patch applies AgentSD to the forward function of the block.
agentsd/patch.py:90
↓ 2 callersMethodmake_res_layer
Pack all blocks in a stage into a ``ResLayer``.
downstream/detection/mmdet/models/backbones/resnet.py:556
↓ 2 callersFunctionmakebarplot
(rs, ps, outDir, class_name, iou_type)
downstream/detection/tools/analysis_tools/coco_error_analysis.py:73
↓ 2 callersFunctionmakeplot
(rs, ps, outDir, class_name, iou_type)
downstream/detection/tools/analysis_tools/coco_error_analysis.py:13
↓ 2 callersMethodmapper
Dictionary mapper. Renames keys according to keymap provided. Args: d (dict): old dict keymap (dict): {'old_key':'new
downstream/detection/mmdet/datasets/pipelines/transforms.py:1448
↓ 2 callersFunctionmask2ndarray
Convert Mask to ndarray.. Args: mask (:obj:`BitmapMasks` or :obj:`PolygonMasks` or torch.Tensor or np.ndarray): The mask to be co
downstream/detection/mmdet/core/utils/misc.py:46
↓ 2 callersFunctionmask_target
Compute mask target for positive proposals in multiple images. Args: pos_proposals_list (list[Tensor]): Positive proposals in multiple
downstream/detection/mmdet/core/mask/mask_target.py:7
↓ 2 callersMethodmeta_info_items
(self)
downstream/detection/mmdet/core/data_structures/general_data.py:191
↓ 2 callersMethodmeta_info_keys
Returns: list: Contains all keys in meta_info_fields.
downstream/detection/mmdet/core/data_structures/general_data.py:166
↓ 2 callersFunctionmulti_gpu_test
Test model with multiple gpus by progressive mode. This method tests model with multiple gpus and collects the results under two different mo
downstream/segmentation/mmseg/apis/test.py:140
↓ 2 callersMethodnorm1
(self)
downstream/segmentation/mmseg/models/backbones/vit.py:104
↓ 2 callersMethodnorm1
nn.Module: normalization layer after the first convolution layer
downstream/segmentation/mmseg/models/backbones/resnet.py:253
↓ 2 callersMethodnorm2
nn.Module: normalization layer after the second convolution layer
downstream/detection/mmdet/models/backbones/resnet.py:254
↓ 2 callersMethodnorm2
(self)
downstream/segmentation/mmseg/models/backbones/vit.py:108
↓ 2 callersMethodnorm3
nn.Module: normalization layer after the third convolution layer
downstream/segmentation/mmseg/models/backbones/resnet.py:263
← previousnext →401–500 of 3,501, ranked by callers