Issue 594: Property-Based Testing for Image Resizing and Preprocessing#664
Open
knoxiboy wants to merge 4 commits into
Open
Issue 594: Property-Based Testing for Image Resizing and Preprocessing#664knoxiboy wants to merge 4 commits into
knoxiboy wants to merge 4 commits into
Conversation
Contributor
Thanks for creating a PR for your Issue!
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds property-based tests for preprocess_image_for_resnet and introduces Hypothesis as a test dependency.
Changes:
- Added Hypothesis-driven tests to validate output tensor shapes for RGB and grayscale inputs.
- Added
hypothesistorequirements.txt(and normalized thepytest-covline formatting).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/test_image_preprocessing.py | Adds property tests for image preprocessing output shapes across varying input sizes. |
| requirements.txt | Adds Hypothesis as a testing dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…trategy bounds, use default deadline, and remove try-except blocks
Owner
|
@knoxiboy resolve conflicts |
Contributor
Author
Done |
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.
What does this PR do?
This PR implements property-based testing using Hypothesis for the
preprocess_image_for_resnetfunction to verify that it correctly resizes and formats arbitrary image dimensions to the target shape.Related Issue
Closes #594
Changes made
hypothesispackage intests/test_image_preprocessing.py.test_preprocess_image_for_resnet_propertyto test resizing behavior with various height/width dimensions for RGB images.test_preprocess_image_for_resnet_grayscaleto test resizing behavior for grayscale (2D) images.preprocess_image_for_resnetinapp.pyto handle grayscale (2D and 1-channel 3D) arrays gracefully by expanding them to 3 channels to comply with ResNet requirements.try-exceptblocks.(1, 3, 224, 224)for grayscale test preprocessing results.Checklist