Skip to content

Add support for new augmentations in rocAL - Group 5#442

Merged
LakshmiKumar23 merged 132 commits into
ROCm:developfrom
SundarRajan28:new_augs_set2
Feb 16, 2026
Merged

Add support for new augmentations in rocAL - Group 5#442
LakshmiKumar23 merged 132 commits into
ROCm:developfrom
SundarRajan28:new_augs_set2

Conversation

@SundarRajan98
Copy link
Copy Markdown
Contributor

@SundarRajan98 SundarRajan98 commented Jan 9, 2026

Motivation

Integrates new RPP augmentations in rocAL:

  • ChannelPermute
  • ColorToGreyscale
  • JpegCompressionDistortion
  • Lut
  • Posterize
  • Solarize

Corresponding MIVisionX PR - #1602

Technical Details

  • Added six new augmentation kernels with both fixed and parameterized variants
  • Implemented C++ node classes for each augmentation with proper initialization and update methods
  • Exposed Python bindings for all new augmentations

Test Plan

Test Result

Submission Checklist

Change copyright
Add unit tests for NonLinearBlend, Gaussian and Median filters
Dilate
Erode
Magnitude
Phase
Remove per-iter updation of perspective array
Add unit test for WarpPerspective
Remove ThresholdFixed
Modify params to accept vector
@kiritigowda kiritigowda added enhancement New feature or request ci:precheckin labels Jan 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds rocAL support for several new RPP augmentations (ChannelPermute, ColorToGreyscale, JpegCompressionDistortion, Lut, Posterize, Solarize) and extends both C++ and Python APIs, along with updating test scripts and image comparison logic.

Changes:

  • Added new C++ augmentation node implementations and exposed them via the rocAL C API.
  • Extended Python bindings (pybind + amd/rocal/fn.py) to expose the new augmentations.
  • Updated Python/C++ test runners and pixel comparison to cover/handle new augmentations and output formats.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/python_api/unit_tests.sh Adds Python API unit-test invocations for new augmentations
tests/python_api/unit_test.py Adds augmentation dispatch for new ops; improves image layout inference for visualization
tests/python_api/image_comparison.py Improves color/grayscale detection; relaxes mismatch rules for stochastic/new ops
tests/cpp_api/unit_tests/unit_tests.cpp Adds new C++ test cases and improves output color-format handling for saving
tests/cpp_api/unit_tests/testAllScripts.sh Adds new C++ test runs for the new augmentation cases
tests/cpp_api/unit_tests/pixel_comparison/image_comparison.py Updates randomized augmentation handling and mismatch relaxations
rocAL_pybind/rocal_pybind.cpp Exposes new augmentations via pybind module defs
rocAL_pybind/amd/rocal/fn.py Adds Python fn.* wrappers for new augmentations
rocAL/source/augmentations/effects_augmentations/node_water.cpp Implements Water node using vxExtRppWater
rocAL/source/augmentations/effects_augmentations/node_spatter.cpp Implements Spatter node using vxExtRppSpatter
rocAL/source/augmentations/effects_augmentations/node_solarize.cpp Implements Solarize node using vxExtRppSolarize
rocAL/source/augmentations/effects_augmentations/node_shot_noise.cpp Implements ShotNoise node using vxExtRppShotNoise
rocAL/source/augmentations/effects_augmentations/node_posterize.cpp Implements Posterize node using vxExtRppPosterize
rocAL/source/augmentations/effects_augmentations/node_lut.cpp Implements LUT node and internal LUT tensor creation
rocAL/source/augmentations/effects_augmentations/node_jpeg_compression_distortion.cpp Implements JPEG compression distortion node
rocAL/source/augmentations/effects_augmentations/node_gaussian_noise.cpp Implements GaussianNoise node using vxExtRppGaussianNoise
rocAL/source/augmentations/color_augmentations/node_color_to_greyscale.cpp Implements ColorToGreyscale node using vxExtRppColorToGreyscale
rocAL/source/augmentations/color_augmentations/node_color_jitter.cpp Implements ColorJitter node using vxExtRppColorJitter
rocAL/source/augmentations/color_augmentations/node_channel_permute.cpp Implements ChannelPermute node using vxExtRppChannelPermute
rocAL/source/augmentations/arithmetic_augmentations/node_log.cpp Implements Log node using vxExtRppLog
rocAL/source/api/rocal_api_augmentation.cpp Adds C API entry points for the new ops and wires them to nodes
rocAL/include/augmentations/effects_augmentations/node_water.h Declares WaterNode and parameter ranges
rocAL/include/augmentations/effects_augmentations/node_spatter.h Declares SpatterNode and parameters
rocAL/include/augmentations/effects_augmentations/node_solarize.h Declares SolarizeNode and threshold range
rocAL/include/augmentations/effects_augmentations/node_shot_noise.h Declares ShotNoiseNode and noise-factor range
rocAL/include/augmentations/effects_augmentations/node_posterize.h Declares PosterizeNode and level-bits range
rocAL/include/augmentations/effects_augmentations/node_lut.h Declares LutNode and LUT tensor/buffer members
rocAL/include/augmentations/effects_augmentations/node_jpeg_compression_distortion.h Declares JpegCompressionDistortionNode and quality range
rocAL/include/augmentations/effects_augmentations/node_gaussian_noise.h Declares GaussianNoiseNode and mean/stddev ranges
rocAL/include/augmentations/color_augmentations/node_color_to_greyscale.h Declares ColorToGreyscaleNode and SubpixelLayout enum
rocAL/include/augmentations/color_augmentations/node_color_jitter.h Declares ColorJitterNode and parameter ranges
rocAL/include/augmentations/color_augmentations/node_channel_permute.h Declares ChannelPermuteNode and permutation array member
rocAL/include/augmentations/augmentations_nodes.h Adds includes for new node headers
rocAL/include/augmentations/arithmetic_augmentations/node_log.h Declares LogNode
rocAL/include/api/rocal_api_augmentation.h Declares new public C APIs and docstrings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rocAL/include/augmentations/effects_augmentations/node_shot_noise.h Outdated
Comment thread rocAL/include/augmentations/effects_augmentations/node_water.h Outdated
Comment thread rocAL/source/augmentations/effects_augmentations/node_spatter.cpp
Comment thread rocAL/source/augmentations/effects_augmentations/node_spatter.cpp
Comment thread rocAL/include/augmentations/effects_augmentations/node_lut.h Outdated
Comment thread rocAL_pybind/amd/rocal/fn.py Outdated
Comment thread rocAL_pybind/amd/rocal/fn.py Outdated
Comment thread rocAL/source/api/rocal_api_augmentation.cpp
Comment thread rocAL/include/api/rocal_api_augmentation.h
@LakshmiKumar23
Copy link
Copy Markdown
Contributor

@SundarRajan28 please take a look at the copilot comets. Some of them can be implemented

LakshmiKumar23
LakshmiKumar23 previously approved these changes Feb 12, 2026
@LakshmiKumar23
Copy link
Copy Markdown
Contributor

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 87.61468% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rocAL/source/api/rocal_api_augmentation.cpp 88.63% 24 Missing ⚠️
...e/augmentations/effects_augmentations/node_lut.cpp 74.39% 21 Missing ⚠️
...tions/color_augmentations/node_channel_permute.cpp 93.94% 2 Missing ⚠️
...augmentations/node_jpeg_compression_distortion.cpp 92.59% 2 Missing ⚠️
...entations/effects_augmentations/node_posterize.cpp 92.86% 2 Missing ⚠️
...mentations/effects_augmentations/node_solarize.cpp 92.86% 2 Missing ⚠️
...ns/color_augmentations/node_color_to_greyscale.cpp 95.65% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #442      +/-   ##
===========================================
+ Coverage    78.98%   79.13%   +0.14%     
===========================================
  Files          307      314       +7     
  Lines        24146    24576     +430     
===========================================
+ Hits         19071    19446     +375     
- Misses        5075     5130      +55     
Files with missing lines Coverage Δ
...ions/color_augmentations/node_color_to_greyscale.h 100.00% <100.00%> (ø)
...gmentations/effects_augmentations/node_spatter.cpp 97.87% <100.00%> (ø)
...ns/color_augmentations/node_color_to_greyscale.cpp 95.65% <95.65%> (ø)
...tions/color_augmentations/node_channel_permute.cpp 93.94% <93.94%> (ø)
...augmentations/node_jpeg_compression_distortion.cpp 92.59% <92.59%> (ø)
...entations/effects_augmentations/node_posterize.cpp 92.86% <92.86%> (ø)
...mentations/effects_augmentations/node_solarize.cpp 92.86% <92.86%> (ø)
...e/augmentations/effects_augmentations/node_lut.cpp 74.39% <74.39%> (ø)
rocAL/source/api/rocal_api_augmentation.cpp 85.18% <88.63%> (+0.31%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SundarRajan28
Copy link
Copy Markdown
Contributor

@LakshmiKumar23 The precheckin CI is passing

@LakshmiKumar23 LakshmiKumar23 merged commit fbb3dd5 into ROCm:develop Feb 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:precheckin enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants