From dac0187576514f30c39e8bb3de2cde9bf919c1d7 Mon Sep 17 00:00:00 2001 From: "PJLAB\\huanghaian" <1286304229@qq.com> Date: Mon, 28 Mar 2022 11:36:57 +0800 Subject: [PATCH] Fix pointrend missing get_uncertainty function bug --- mmdet/models/roi_heads/mask_heads/mask_point_head.py | 5 +++-- mmdet/models/utils/__init__.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mmdet/models/roi_heads/mask_heads/mask_point_head.py b/mmdet/models/roi_heads/mask_heads/mask_point_head.py index c022f1fdbc7..c77c46d2c6f 100644 --- a/mmdet/models/roi_heads/mask_heads/mask_point_head.py +++ b/mmdet/models/roi_heads/mask_heads/mask_point_head.py @@ -8,7 +8,8 @@ from mmcv.runner import BaseModule from mmdet.models.builder import HEADS, build_loss -from mmdet.models.utils import get_uncertain_point_coords_with_randomness +from mmdet.models.utils import (get_uncertain_point_coords_with_randomness, + get_uncertainty) @HEADS.register_module() @@ -230,7 +231,7 @@ def get_roi_rel_points_test(self, mask_pred, pred_label, cfg): most uncertain points from the [mask_height, mask_width] grid . """ num_points = cfg.subdivision_num_points - uncertainty_map = self._get_uncertainty(mask_pred, pred_label) + uncertainty_map = get_uncertainty(mask_pred, pred_label) num_rois, _, mask_height, mask_width = uncertainty_map.shape # During ONNX exporting, the type of each elements of 'shape' is diff --git a/mmdet/models/utils/__init__.py b/mmdet/models/utils/__init__.py index 6d9c4057a39..e74ba89e8c2 100644 --- a/mmdet/models/utils/__init__.py +++ b/mmdet/models/utils/__init__.py @@ -10,7 +10,8 @@ from .misc import interpolate_as, sigmoid_geometric_mean from .normed_predictor import NormedConv2d, NormedLinear from .panoptic_gt_processing import preprocess_panoptic_gt -from .point_sample import get_uncertain_point_coords_with_randomness +from .point_sample import (get_uncertain_point_coords_with_randomness, + get_uncertainty) from .positional_encoding import (LearnedPositionalEncoding, SinePositionalEncoding) from .res_layer import ResLayer, SimplifiedBasicBlock @@ -29,5 +30,5 @@ 'adaptive_avg_pool2d', 'AdaptiveAvgPool2d', 'PatchEmbed', 'nchw_to_nlc', 'nlc_to_nchw', 'pvt_convert', 'sigmoid_geometric_mean', 'preprocess_panoptic_gt', 'DyReLU', - 'get_uncertain_point_coords_with_randomness' + 'get_uncertain_point_coords_with_randomness', 'get_uncertainty' ]