RandomChoiceResize¶
- class mmcv.transforms.RandomChoiceResize(scales: Sequence[Union[int, Tuple]], resize_type: str = 'Resize', **resize_kwargs)[源代码]¶
Resize images & bbox & mask from a list of multiple scales.
This transform resizes the input image to some scale. Bboxes and masks are then resized with the same scale factor. Resize scale will be randomly selected from
scales
.How to choose the target scale to resize the image will follow the rules below:
if scale is a list of tuple, the target scale is sampled from the list uniformally.
if scale is a tuple, the target scale will be set to the tuple.
Required Keys:
img
gt_bboxes (optional)
gt_seg_map (optional)
gt_keypoints (optional)
Modified Keys:
img
img_shape
gt_bboxes (optional)
gt_seg_map (optional)
gt_keypoints (optional)
Added Keys:
scale
scale_factor
scale_idx
keep_ratio
- 参数
注解
By defaults, the
resize_type
is “Resize”, if it’s not overwritten by your registry, it indicates themmcv.Resize
. And therefore,resize_kwargs
accepts any keyword arguments of it, likekeep_ratio
,interpolation
and so on.If you want to use your custom resize class, the class should accept
scale
argument and havescale
attribution which determines the resize shape.