diff --git a/ppdet/modeling/layers.py b/ppdet/modeling/layers.py index 0dbfd3bc5fa5f4c78121a5cb8b3896120361388a..671907898050904f5a09a52e11bec7e51d6851de 100644 --- a/ppdet/modeling/layers.py +++ b/ppdet/modeling/layers.py @@ -302,7 +302,6 @@ class RoIExtractor(object): feats[self.start_level], roi, self.resolution, - self.resolution, spatial_scale, rois_num=rois_num) return rois_feat @@ -323,7 +322,6 @@ class RoIExtractor(object): feats[lvl], rois_dist[lvl], self.resolution, - self.resolution, spatial_scale[lvl], sampling_ratio=self.sampling_ratio, rois_num=rois_num_dist[lvl]) diff --git a/ppdet/modeling/ops.py b/ppdet/modeling/ops.py index 5066c21643ded97557ae93bf88ddc5cf69a6bc8a..fcfd9ef8a3a2013ff545d3e3ac154cf6e53a374d 100644 --- a/ppdet/modeling/ops.py +++ b/ppdet/modeling/ops.py @@ -168,8 +168,10 @@ def roi_align(input, The data type is float32 or float64. Given as [[x1, y1, x2, y2], ...], (x1, y1) is the top left coordinates, and (x2, y2) is the bottom right coordinates. output_size (int or tuple[int, int]): The pooled output size(h, w), data type is int32. If int, h and w are both equal to output_size. - spatial_scale (float32, optional): ${spatial_scale_comment} Default: 1.0 - sampling_ratio(int32, optional): ${sampling_ratio_comment} Default: -1 + spatial_scale (float32, optional): Multiplicative spatial scale factor to translate ROI coords + from their input scale to the scale used when pooling. Default: 1.0 + sampling_ratio(int32, optional): number of sampling points in the interpolation grid. + If <=0, then grid points are adaptive to roi_width and pooled_w, likewise for height. Default: -1 rois_num (Tensor): The number of RoIs in each image. Default: None name(str, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and @@ -199,6 +201,7 @@ def roi_align(input, sampling_ratio=-1, rois_num=rois_num) """ + check_type(output_size, 'output_size', (int, tuple), 'roi_align') if isinstance(output_size, int): output_size = (output_size, output_size)