[Testing] Rewrite python tests for Normalize, CvtColor, BilateralFilter, BndBox, Histogram, GammaContrast, Composite#64
Merged
zacharyvincze merged 19 commits intoROCm:developfrom Sep 12, 2025
Conversation
…te-remaining-pytests
…te-remaining-pytests
…te-remaining-pytests
There was a problem hiding this comment.
Pull Request Overview
This PR rewrites Python tests for multiple computer vision operators to eliminate dependency on expected test images and makes tests more maintainable by using generated random tensors instead. It also fixes a batch size bug in the Histogram operator's Python bindings.
- Rewrites tests for Normalize, CvtColor, BilateralFilter, BndBox, Histogram, GammaContrast, and Composite operators
- Fixes hardcoded batch size bug in Histogram operator Python definition
- Removes dependency on expected test images by using tensor comparison approach
Reviewed Changes
Copilot reviewed 10 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test_op_normalize.py | Replaces image-based tests with parametrized tests using generated tensors |
| test_op_non_max_suppression.py | Updates to use tensor generation and comparison instead of binary file comparison |
| test_op_histogram.py | Converts from grayscale image input to generated tensor input with tensor comparison |
| test_op_gamma_contrast.py | Replaces image loading with generated tensor approach and tensor comparison |
| test_op_cvt_color.py | Updates color conversion tests to use generated tensors and parametrized color codes |
| test_op_composite.py | Converts composite operation tests to use generated tensors for all inputs |
| test_op_bnd_box.py | Replaces hardcoded bounding box setup with random box generation |
| test_op_bilateral_filter.py | Updates bilateral filter tests with generated tensors and expanded parameter testing |
| test_helpers.py | Adds generic tensor generation function and updates parameter naming |
| py_op_histogram.cpp | Fixes batch size calculation bug that was hardcoded to 1 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
paveltc
approved these changes
Sep 10, 2025
jeffqjiangNew
approved these changes
Sep 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Aims to rewrite python tests so that they are no longer reliant on expected test images.
Technical Details
Test Plan
Test Result
Submission Checklist