Class ResizePreserveAR

Inheritance Relationships

Base Type

Class Documentation

class ResizePreserveAR : public mindspore::dataset::TensorTransform

Keep the original picture ratio and fills the rest.

Public Functions

ResizePreserveAR(int32_t height, int32_t width, int32_t img_orientation = 0)

Constructor.

参数
  • height[in] The height of image output value after resizing.

  • width[in] The width of image output value after resizing.

  • img_orientation[in] optional rotation angle.

    • img_orientation = 1, Rotate 0 degree.

    • img_orientation = 2, Rotate 0 degree and apply horizontal flip.

    • img_orientation = 3, Rotate 180 degree.

    • img_orientation = 4, Rotate 180 degree and apply horizontal flip.

    • img_orientation = 5, Rotate 90 degree and apply horizontal flip.

    • img_orientation = 6, Rotate 90 degree.

    • img_orientation = 7, Rotate 270 degree and apply horizontal flip.

    • img_orientation = 8, Rotate 270 degree.

样例
/* Define operations */
auto decode_op = vision::Decode();
auto resize_op = vision::ResizePreserveAR(224, 224);

/* dataset is an instance of Dataset object */
dataset = dataset->Map({decode_op, resize_op},  // operations
                       {"image"});              // input columns
~ResizePreserveAR() = default

Destructor.