RPP effects augmentations#
-
RppStatus rppt_gridmask(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u tileWidth, Rpp32f gridRatio, Rpp32f gridAngle, RpptUintVector2D translateVector, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Gridmask augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The gridmask augmentation runs as per https://arxiv.org/abs/2001.04086 for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
tileWidth – [in] tileWidth value for gridmask calculation = width of black square + width of spacing until next black square on grid (a single Rpp32u number with tileWidth <= min(srcDescPtr->w, srcDescPtr->h) that applies to all images in the batch)
gridRatio – [in] gridRatio value for gridmask calculation = black square width / tileWidth (a single Rpp32f number with 0 <= gridRatio <= 1 that applies to all images in the batch)
gridAngle – [in] gridAngle value for gridmask calculation = grid rotation angle in radians (a single Rpp32f number that applies to all images in the batch)
translateVector – [in] translateVector for gridmask calculation = grid X and Y translation lengths in pixels (a single RpptUintVector2D x,y value pair that applies to all images in the batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_spatter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRGB spatterColor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Spatter augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The spatter augmentation adds random spatter of a user-defined color, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output - Mud Spatter#
Sample Output - Ink Spatter#
Sample Output - Blood Spatter#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
spatterColor – [in] RGB values to use for the spatter augmentation (A single set of 3 Rpp8u values as RpptRGB that applies to all images in the batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y)) | (Restrictions - roiTensorPtrSrc[i].xywhROI.roiWidth <= 1920 and roiTensorPtrSrc[i].xywhROI.roiHeight <= 1080)
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_salt_and_pepper_noise(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *noiseProbabilityTensor, Rpp32f *saltProbabilityTensor, Rpp32f *saltValueTensor, Rpp32f *pepperValueTensor, Rpp32u seed, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Salt and pepper noise augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The salt and pepper noise augmentation adds SnP noise based on user defined noise/salt probabilities, and user defined salt/pepper values for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
noiseProbabilityTensor – [in] noiseProbability values to decide if a destination pixel is a noise-pixel, or equal to source (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 <= noiseProbabilityTensor[i] <= 1 for each image in batch)
saltProbabilityTensor – [in] saltProbability values to decide if a given destination noise-pixel is salt or pepper (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 <= saltProbabilityTensor[i] <= 1 for each image in batch)
saltValueTensor – [in] A user-defined salt noise value (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 <= saltValueTensor[i] <= 1 for each image in batch)
pepperValueTensor – [in] A user-defined pepper noise value (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 <= pepperValueTensor[i] <= 1 for each image in batch)
seed – [in] A user-defined seed value (single Rpp32u value)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_shot_noise(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *shotNoiseFactorTensor, Rpp32u seed, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Shot noise augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The shot noise augmentation adds Poisson/shot noise based on a user defined shotNoiseFactor, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
shotNoiseFactorTensor – [in] shotNoiseFactor values for each image, which are used to compute the lambda values in a poisson distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with shotNoiseFactorTensor[i] >= 0 for each image in batch)
seed – [in] A user-defined seed value (single Rpp32u value)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_gaussian_noise(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp32u seed, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Gaussian noise augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The gaussian noise augmentation adds Gaussian noise based on user defined means and standard deviations, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
meanTensor – [in] mean values for each image, which are used to compute the generalized Box-Mueller transforms in a gaussian distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with meanTensor[i] >= 0 for each image in batch)
stdDevTensor – [in] stdDev values for each image, which are used to compute the generalized Box-Mueller transforms in a gaussian distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with stdDevTensor[i] >= 0 for each image in batch)
seed – [in] A user-defined seed value (single Rpp32u value)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_non_linear_blend(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *stdDevTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Non linear blend augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The non linear blend augmentation adds standard deviation based non-linear alpha-blending, between two sets of batches of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input1#
Sample Input2#
Sample Output#
- Parameters:
srcPtr1 – [in] source1 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcPtr2 – [in] source2 tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
stdDevTensor – [in] stdDev values for each image, which are used to compute the generalized Box-Mueller transforms in a gaussian distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with stdDevTensor[i] >= 0 for each image in batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_water(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *amplitudeXTensor, Rpp32f *amplitudeYTensor, Rpp32f *frequencyXTensor, Rpp32f *frequencyYTensor, Rpp32f *phaseXTensor, Rpp32f *phaseYTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Water augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The water augmentation adds a water effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
amplitudeXTensor – [in] amplitudeX values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
amplitudeYTensor – [in] amplitudeY values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
frequencyXTensor – [in] frequencyX values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
frequencyYTensor – [in] frequencyY values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
phaseXTensor – [in] phaseX values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
phaseYTensor – [in] phaseY values for water effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_ricap(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u *permutationTensor, RpptROIPtr roiPtrInputCropRegion, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
RICAP (Random Image Crop And Patch) augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The RICAP (Random Image Crop And Patch) augmentation runs as per https://arxiv.org/abs/1811.09030
for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
The RICAP augmentation requires dimensions of input images to be the same across entire batch.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input1#
Sample Input2#
Sample Input3#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
permutationTensor – [in] Array of batchSize permutation sets (2D tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend), of batchSize * 4. Each set of 4 permutations contains Rpp32u image indices for each region in the respective RICAP-output-image in the batch)
roiPtrInputCropRegion – [in] Array of 4 ROIs (2D tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend), of size 4 * 4-elements per ROI, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_vignette(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *vignetteIntensityTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Vignette augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The Vignette augmentation adds a vignette effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
vignetteIntensityTensor – [in] intensity values to quantify vignette effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 < vignetteIntensityTensor[n] for each image in batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_jitter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u *kernelSizeTensor, Rpp32u seed, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Jitter augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The jitter augmentation adds a jitter effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
kernelSizeTensor – [in] kernelsize value for jitter calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), kernelSize = 3/5/7 for optimal use)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_gaussian_noise_voxel(RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp32u seed, RpptROI3DPtr roiGenericPtrSrc, RpptRoi3DType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Gaussian noise augmentation on HIP/HOST backend.
This function adds gaussian noise to a batch of 4D tensors. Support added for u8 -> u8, f32 -> f32 datatypes.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcGenericDescPtr – [in] source tensor descriptor
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstGenericDescPtr – [in] destination tensor descriptor
meanTensor – [in] mean values for each input, which are used to compute the generalized Box-Mueller transforms in a gaussian distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with meanTensor[i] >= 0 for each image in batch)
stdDevTensor – [in] stdDev values for each image, which are used to compute the generalized Box-Mueller transforms in a gaussian distribution (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with stdDevTensor[i] >= 0 for each image in batch)
seed – [in] A user-defined seed value (single Rpp32u value)
roiGenericPtrSrc – [in] ROI data for each image in source tensor (tensor of batchSize RpptRoiGeneric values)
roiType – [in] ROI type used (RpptRoi3DType::XYZWHD or RpptRoi3DType::LTFRBB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_erase(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRoiLtrb *anchorBoxInfoTensor, RppPtr_t colorsTensor, Rpp32u *numBoxesTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Erase augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function erases one or more user defined regions from an image, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
anchorBoxInfoTensor – [in] anchorBoxInfo values of type RpptRoiLtrb for each erase-region inside each image in the batch (tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)). Restrictions -
0 <= anchorBoxInfo[i] < respective image width/height
Erase-region anchor boxes on each image given by the user must not overlap
colorsTensor – [in] RGB values to use for each erase-region inside each image in the batch (tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)). (colors[i] will have range equivalent of srcPtr)
numBoxesTensor – [in] number of erase-regions per image, for each image in the batch (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend)). (numBoxesTensor[n] >= 0)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_glitch(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptChannelOffsets *rgbOffsets, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Glitch augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The glitch augmentation adds a glitch effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
rgbOffsets – [in] RGB offset values to use for the glitch augmentation (A single set of 3 Rppi point values that applies to all images in the batch. For each point and for each image in the batch: 0 < point.x < width, 0 < point.y < height)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend) for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_rain(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f rainPercentage, Rpp32u rainWidth, Rpp32u rainHeight, Rpp32f slantAngle, Rpp32f *alpha, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Rain augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The rain augmentation simulates a rain effect for a batch of RGB (3-channel) / greyscale (1-channel) images with an NHWC/NCHW tensor layout. NOTE: This augmentation gives a more realistic Rain output when all images in a batch are of similar / same sizes
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be the same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
rainPercentage – [in] The percentage of the rain effect to be applied (0 <= rainPercentage <= 100)
rainWidth – [in] Width of the rain drops in pixels. To be tuned by user depending on size of the image.
rainHeight – [in] Height of the rain drops in pixels. To be tuned by user depending on size of the image.
slantAngle – [in] Slant angle of the rain drops (positive value for right slant, negative for left slant). A single Rpp32s/f representing the slant of raindrops in degrees. Values range from [-90, 90], where -90 represents extreme left slant, 0 is vertical, and 90 is extreme right slant.
alpha – [in] An array of alpha blending values to be used for blending the rainLayer and the input image for each image in the batch (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), 0 ≤ alpha ≤ 1 for each image in the batch).
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend) for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreateWithBatchSize()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_pixelate(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RppPtr_t intermediateScratchBufferPtr, Rpp32f pixelationPercentage, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Pixelate augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The pixelate augmentation performs a pixelate transformation for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
intermediateScratchBufferPtr – [in] intermediate scratch buffer in HIP memory (for HIP backend) or HOST memory (for HOST backend) (Minimum size = srcDescPtr->n * srcDescPtr->strides.nStride * sizeof(Rpp32f))
pixelationPercentage – [in] ‘pixelationPercentage’ variable controls how much pixelation is applied to images.(pixelationPercentage value ranges from 0 to 100)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_fog(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *intensityFactor, Rpp32f *greyFactor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Fog augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The fog augmentation adds a fog effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout. NOTE: This augmentation gives a more realistic fog output when all images in a batch are of similar / same sizes
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
intensityFactor – [in] intensity factor values for fog calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, with 0 <= intensityFactor <= 0.5 for each image in batch)
greyFactor – [in] gray factor values to introduce grayness in the image for fog calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, with 0 <= greyFactor <= 1 for each image in batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend) for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HOST/HIP handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_posterize(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp8u *posterizeLevelBits, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Posterize augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The posterize augmentation adds a posterize effect for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
posterizeLevelBits – [in] number of bits used to represent the image with posterize Operation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, with 1 <= posterizeLevelBits <= 8 for each image in batch))
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend) for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_solarize(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *thresholdTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Solarize augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The solarize augmentation inverts pixel values above a specified threshold for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
thresholdTensor – [in] threshold values for solarize effect (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, with 0 <= threshold <= 1 for each image in batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend) for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_snow(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *brightnessCoefficient, Rpp32f *snowThreshold, Rpp32s *darkMode, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Snow augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The Snow augmentation adds a snowed-in effect on a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
brightnessCoefficient – [in] brightness modification parameter for snow calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with brightnessCoefficient[i] in the range (1, 4] for each image in batch)
snowThreshold – [in] threshold parameter for snow calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize with 0 < snowThreshold[i] <= 1 for each image in batch)
darkMode – [in] darkMode values to set dark mode on/off (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, with darkMode[i] = 0/1)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_channel_dropout(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp8u *dropoutTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Channel dropout augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
The channel dropout augmentation function erases one or more user defined channel from an image, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
dropoutTensor – [in] channel dropout tensor (1D Rpp8u tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize * channels Values must be 0 (Drop) or 1 (Keep) for each channel of each image in batch)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_cutout_dropout(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRoiLtrb *anchorBoxInfoTensor, RppPtr_t colorsTensor, Rpp32u *numBoxesTensor, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Cutout dropout augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
Cutout dropout function erases random regions from an image, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
anchorBoxInfoTensor – [in] precomputed cutout erase regions for the batch in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), stored as a flat array of RpptRoiLtrb of size (batchSize * maxBoxesPerImage), where maxBoxesPerImage = max(numBoxesTensor[n])
colorsTensor – [in] pointer to erase color values for each erase region in HIP memory (for HIP backend) or HOST memory (for HOST backend), laid out identically to anchorBoxInfoTensor, i.e., of size (batchSize * maxBoxesPerImage), with colorsTensor[(n * maxBoxesPerImage) + k]
numBoxesTensor – [in] number of erase regions per image in the batch in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend) (1D tensor of size batchSize, Data Type - Rpp32u*)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_grid_dropout(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRoiLtrb *anchorBoxInfoTensor, Rpp32u boxesInEachImage, Rpp32u maxHoleW, Rpp32u maxHoleH, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Grid dropout augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
Grid dropout function erases grid wise random regions from an image, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
boxesInEachImage)
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
anchorBoxInfoTensor – [in] Precomputed grid erase regions for the batch in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), stored as an array of RpptRoiLtrb of size (batchSize
boxesInEachImage – [in] Number of grid boxes per image (Data Type - Rpp32u)
maxHoleW – [in] Maximum hole width across all grid boxes (Data Type - Rpp32u)
maxHoleH – [in] Maximum hole height across all grid boxes (Data Type - Rpp32u)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_random_erase(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRoiLtrb *anchorBoxInfoTensor, RppPtr_t noiseBuffer, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Random Erase augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function erases random regions from an image and fills with random noise, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
anchorBoxInfoTensor – [in] anchorBoxInfo values of type RpptRoiLtrb for each erase-region inside each image in the batch (tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend)). Restrictions -
0 <= anchorBoxInfo[i] < respective image width/height
Erase-region anchor boxes on each image given by the user must not overlap
noiseBuffer – [in] pre-allocated buffer containing random noise values in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend) (Buffer size must be 255 * 255 * srcDescPtr->c. Values are accessed spatially (tiled) to fill erased regions)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.
-
RppStatus rppt_coarse_dropout(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptRoiLtrb *anchorBoxInfoTensor, Rpp32u *numBoxesTensor, Rpp32u maxBoxesPerImage, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#
Coarse dropout augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.
This function erases one or more user defined regions from an image, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.
srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127). dstPtr depth ranges - Will be same depth as srcPtr.
Sample Input#
Sample Output#
- Parameters:
srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)
dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)
anchorBoxInfoTensor – [in] anchorBoxInfo values of type RpptRoiLtrb for each erase-region inside each image in the batch (tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend)). Restrictions -
0 <= anchorBoxInfo[i] < respective image width/height
Erase-region anchor boxes on each image given by the user must not overlap
numBoxesTensor – [in] number of erase-regions per image, for each image in the batch (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend)). (numBoxesTensor[n] >= 0)
maxBoxesPerImage – [in] Maximum number of erase-regions allocated per image in the batch (stride for anchorBoxInfoTensor/colorsTensor)
roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))
roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)
rppHandle – [in] RPP HIP/HOST handle created with
rppCreate()executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)
- Return values:
RPP_SUCCESS – Successful completion.
RPP_ERROR* – Unsuccessful completion.
- Returns:
A
RppStatusenumeration.