|
|
|
@ -75,8 +75,8 @@ std::shared_ptr<CenterCropOperation> CenterCrop(std::vector<int32_t> size);
|
|
|
|
|
std::shared_ptr<CropOperation> Crop(std::vector<int32_t> coordinates, std::vector<int32_t> size);
|
|
|
|
|
|
|
|
|
|
/// \brief Function to apply CutMix on a batch of images
|
|
|
|
|
/// \notes Masks a random section of each image with the corresponding part of another randomly selected image in
|
|
|
|
|
/// that batch
|
|
|
|
|
/// \notes Masks a random section of each image with the corresponding part of another randomly
|
|
|
|
|
/// selected image in that batch
|
|
|
|
|
/// \param[in] image_batch_format The format of the batch
|
|
|
|
|
/// \param[in] alpha The hyperparameter of beta distribution (default = 1.0)
|
|
|
|
|
/// \param[in] prob The probability by which CutMix is applied to each image (default = 1.0)
|
|
|
|
@ -103,8 +103,8 @@ std::shared_ptr<DecodeOperation> Decode(bool rgb = true);
|
|
|
|
|
std::shared_ptr<HwcToChwOperation> HWC2CHW();
|
|
|
|
|
|
|
|
|
|
/// \brief Function to create a MixUpBatch TensorOperation.
|
|
|
|
|
/// \notes Apply MixUp transformation on an input batch of images and labels. The labels must be in one-hot format and
|
|
|
|
|
/// Batch must be called before calling this function.
|
|
|
|
|
/// \notes Apply MixUp transformation on an input batch of images and labels. The labels must be in
|
|
|
|
|
/// one-hot format and Batch must be called before calling this function.
|
|
|
|
|
/// \param[in] alpha hyperparameter of beta distribution (default = 1.0)
|
|
|
|
|
/// \return Shared pointer to the current TensorOperation.
|
|
|
|
|
std::shared_ptr<MixUpBatchOperation> MixUpBatch(float alpha = 1);
|
|
|
|
@ -112,7 +112,9 @@ std::shared_ptr<MixUpBatchOperation> MixUpBatch(float alpha = 1);
|
|
|
|
|
/// \brief Function to create a Normalize TensorOperation.
|
|
|
|
|
/// \notes Normalize the input image with respect to mean and standard deviation.
|
|
|
|
|
/// \param[in] mean A vector of mean values for each channel, w.r.t channel order.
|
|
|
|
|
/// The mean values must be in range (0.0, 255.0].
|
|
|
|
|
/// \param[in] std A vector of standard deviations for each channel, w.r.t. channel order.
|
|
|
|
|
/// The standard deviation values must be in range (0.0, 255.0]
|
|
|
|
|
/// \return Shared pointer to the current TensorOperation.
|
|
|
|
|
std::shared_ptr<NormalizeOperation> Normalize(std::vector<float> mean, std::vector<float> std);
|
|
|
|
|
|
|
|
|
@ -146,8 +148,8 @@ std::shared_ptr<PadOperation> Pad(std::vector<int32_t> padding, std::vector<uint
|
|
|
|
|
/// if size is 4, (min_dx, max_dx, min_dy, max_dy)
|
|
|
|
|
/// all values are in range [-1, 1]
|
|
|
|
|
/// \param[in] scale_range A float vector of size 2, representing the starting and ending scales in the range.
|
|
|
|
|
/// \param[in] shear_ranges A float vector of size 2 or 4, representing the starting and ending shear degrees vertically
|
|
|
|
|
/// and horizontally.
|
|
|
|
|
/// \param[in] shear_ranges A float vector of size 2 or 4, representing the starting and ending shear degrees
|
|
|
|
|
/// vertically and horizontally.
|
|
|
|
|
/// if size is 2, (min_shear_x, max_shear_x, 0, 0)
|
|
|
|
|
/// if size is 4, (min_shear_x, max_shear_x, min_shear_y, max_shear_y)
|
|
|
|
|
/// \param[in] interpolation An enum for the mode of interpolation
|
|
|
|
@ -202,14 +204,14 @@ std::shared_ptr<RandomCropOperation> RandomCrop(std::vector<int32_t> size, std::
|
|
|
|
|
|
|
|
|
|
/// \brief Function to create a RandomCropDecodeResize TensorOperation.
|
|
|
|
|
/// \notes Equivalent to RandomResizedCrop, but crops before decodes.
|
|
|
|
|
/// \param[in] size - a vector representing the output size of the cropped image.
|
|
|
|
|
/// \param[in] size A vector representing the output size of the cropped image.
|
|
|
|
|
/// If size is a single value, a square crop of size (size, size) is returned.
|
|
|
|
|
/// If size has 2 values, it should be (height, width).
|
|
|
|
|
/// \param[in] scale - range [min, max) of respective size of the
|
|
|
|
|
/// \param[in] scale Range [min, max) of respective size of the
|
|
|
|
|
/// original size to be cropped (default=(0.08, 1.0))
|
|
|
|
|
/// \param[in] ratio - range [min, max) of aspect ratio to be
|
|
|
|
|
/// \param[in] ratio Range [min, max) of aspect ratio to be
|
|
|
|
|
/// cropped (default=(3. / 4., 4. / 3.))
|
|
|
|
|
/// \param[in] interpolation - an enum for the mode of interpolation
|
|
|
|
|
/// \param[in] interpolation An enum for the mode of interpolation
|
|
|
|
|
/// \param[in] The maximum number of attempts to propose a valid crop_area (default=10).
|
|
|
|
|
/// If exceeded, fall back to use center_crop instead.
|
|
|
|
|
/// \return Shared pointer to the current TensorOperation.
|
|
|
|
@ -266,14 +268,15 @@ std::shared_ptr<RandomRotationOperation> RandomRotation(
|
|
|
|
|
std::shared_ptr<RandomSharpnessOperation> RandomSharpness(std::vector<float> degrees = {0.1, 1.9});
|
|
|
|
|
|
|
|
|
|
/// \brief Function to create a RandomSolarize TensorOperation.
|
|
|
|
|
/// \notes Invert pixels within specified range. If min=max, then it inverts all pixel above that threshold
|
|
|
|
|
/// \notes Invert pixels randomly within specified range. If min=max, it is a single fixed magnitude operation
|
|
|
|
|
/// to inverts all pixel above that threshold
|
|
|
|
|
/// \param[in] threshold A vector with two elements specifying the pixel range to invert.
|
|
|
|
|
/// \return Shared pointer to the current TensorOperation.
|
|
|
|
|
std::shared_ptr<RandomSolarizeOperation> RandomSolarize(std::vector<uint8_t> threshold = {0, 255});
|
|
|
|
|
|
|
|
|
|
/// \brief Function to create a RandomVerticalFlip TensorOperation.
|
|
|
|
|
/// \notes Tensor operation to perform random vertical flip.
|
|
|
|
|
/// \param[in] prob - float representing the probability of flip.
|
|
|
|
|
/// \param[in] prob A float representing the probability of flip.
|
|
|
|
|
/// \return Shared pointer to the current TensorOperation.
|
|
|
|
|
std::shared_ptr<RandomVerticalFlipOperation> RandomVerticalFlip(float prob = 0.5);
|
|
|
|
|
|
|
|
|
|