a6236b789b8f4e2e66c8379199f40ecef9afce06,mmdet/models/anchor_heads/guided_anchor_head.py,GuidedAnchorHead,get_anchors,#GuidedAnchorHead#Any#Any#Any#Any#Any#Any#,312

Before Change


        // squares for one time
        multi_level_squares = []
        for i in range(num_levels):
            squares = self.square_generators[i].grid_anchors(
                featmap_sizes[i], self.anchor_strides[i], device=device)
            multi_level_squares.append(squares)
        squares_list = [multi_level_squares for _ in range(num_imgs)]

        // for each image, we compute multi level guided anchors

After Change


            inside_flag_list.append(multi_level_flags)
        return approxs_list, inside_flag_list

    def get_anchors(self,
                    featmap_sizes,
                    shape_preds,
                    loc_preds,
                    img_metas,
                    use_loc_filter=False,
                    device="cuda"):
        Get squares according to feature map sizes and guided
        anchors.

        Args:
            featmap_sizes (list[tuple]): Multi-level feature map sizes.
            shape_preds (list[tensor]): Multi-level shape predictions.
            loc_preds (list[tensor]): Multi-level location predictions.
            img_metas (list[dict]): Image meta info.
            use_loc_filter (bool): Use loc filter or not.
            device (torch.device | str): device for returned tensors

        Returns:
            tuple: square approxs of each image, guided anchors of each image,
                loc masks of each image
        
        num_imgs = len(img_metas)
        num_levels = len(featmap_sizes)

        // since feature map sizes of all images are the same, we only compute
        // squares for one time
        multi_level_squares = self.square_anchor_generator.grid_anchors(
            featmap_sizes, device=device)
        squares_list = [multi_level_squares for _ in range(num_imgs)]

        // for each image, we compute multi level guided anchors
        guided_anchors_list = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: open-mmlab/mmdetection
Commit Name: a6236b789b8f4e2e66c8379199f40ecef9afce06
Time: 2020-04-21
Author: 40779233+ZwwWayne@users.noreply.github.com
File Name: mmdet/models/anchor_heads/guided_anchor_head.py
Class Name: GuidedAnchorHead
Method Name: get_anchors


Project Name: open-mmlab/mmdetection
Commit Name: a6236b789b8f4e2e66c8379199f40ecef9afce06
Time: 2020-04-21
Author: 40779233+ZwwWayne@users.noreply.github.com
File Name: mmdet/models/anchor_heads/anchor_head.py
Class Name: AnchorHead
Method Name: get_bboxes


Project Name: open-mmlab/mmdetection
Commit Name: a6236b789b8f4e2e66c8379199f40ecef9afce06
Time: 2020-04-21
Author: 40779233+ZwwWayne@users.noreply.github.com
File Name: mmdet/models/anchor_heads/atss_head.py
Class Name: ATSSHead
Method Name: get_bboxes