Class ResizeWithBBox
Defined in File vision.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
Class Documentation
-
class ResizeWithBBox : public mindspore::dataset::TensorTransform
Resize the input image to the given size and adjust bounding boxes accordingly.
Public Functions
-
explicit ResizeWithBBox(const std::vector<int32_t> &size, InterpolationMode interpolation = InterpolationMode::kLinear)
Constructor.
- Parameters
size – [in] The output size of the resized image. If the size is an integer, smaller edge of the image will be resized to this value with the same image aspect ratio. If the size is a sequence of length 2, it should be (height, width).
interpolation – [in] An enum for the mode of interpolation (default=InterpolationMode::kLinear).
InterpolationMode::kLinear, Interpolation method is blinear interpolation.
InterpolationMode::kNearestNeighbour, Interpolation method is nearest-neighbor interpolation.
InterpolationMode::kCubic, Interpolation method is bicubic interpolation.
InterpolationMode::kArea, Interpolation method is pixel area interpolation.
InterpolationMode::kCubicPil, Interpolation method is bicubic interpolation like implemented in pillow.
样例/* Define operations */ auto random_op = vision::ResizeWithBBox({100, 100}, InterpolationMode::kNearestNeighbour); /* dataset is an instance of Dataset object */ dataset = dataset->Map({random_op}, // operations {"image", "bbox"}); // input columns
-
~ResizeWithBBox() = default
Destructor.
-
explicit ResizeWithBBox(const std::vector<int32_t> &size, InterpolationMode interpolation = InterpolationMode::kLinear)