-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Square Pad and Resize Preprocessors #2138
Implement Square Pad and Resize Preprocessors #2138
Conversation
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev_1.15.0 #2138 +/- ##
==============================================
+ Coverage 85.64% 85.66% +0.01%
==============================================
Files 299 306 +7
Lines 26656 27047 +391
Branches 4878 4968 +90
==============================================
+ Hits 22830 23170 +340
- Misses 2581 2604 +23
- Partials 1245 1273 +28
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @f4str Thank you very much for your pull request! I have added a few questions, what do you think?
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Hi @beat-buesser thank you for the comments! I've addressed the review comments and have made the corresponding changes. Feel free to let me know if there any other issues. |
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @f4str Thank you very much for contributing image preprocessors to ART!
Description
A new module
art.preprocessing.image
was created which will contain all image preprocessors. Under this module, new image preprocessors for square padding and resizing were created. Both of these preprocessors work for both the classification and object detection tasks. For classification, the labels are not changed. For object detection, the bounding boxes of the labels are shifted/scaled accordingly based on the padding or resizing.The Square Pad preprocessor (
ImageSquarePad
,ImageSquarePadPyTorch
, andImageSquarePadTensorFlowV2
) will pad all images to be a square shape. The user is capable of specifying the type of padding (e.g., constant or symmetric) and any additional parameters taken by the corresponding framework-specific padding function. This preprocessor can also take either a ndarray/tensor of the same image size or a list of ndarray/tensor of arbitrary sizes and still square pad accordingly.The Resize preprocessor (
ImageResize
,ImageResizePyTorch
, andImageResizeTensorFlowV2
) will resize all image to the be same user specified height and width. The user is capable of specifying the interpolation method used for resizing (e.g., bilinear or area). This preprocessor can also take either a ndarray/tensor of the same image size or a list of ndarray/tensor of arbitrary sizes and still resize all images to the same dimensions. This preprocessor will always convert the resized images into one large ndarray/tensor so this is ideal last step for the training pipeline.For training, the Square Pad preprocessor should be followed by the Resize processor so images of arbitrary sizes can be padded to preserve their aspect ratio and then resized to be fit into a model. These preprocessors are necessary for properly training the YOLO estimators.
Fixes #2130
Fixes #2082
Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
Test Configuration:
Checklist