-
Notifications
You must be signed in to change notification settings - Fork 609
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
Rotate operator using Warp kernel #1403
Conversation
!build |
CI MESSAGE: [951222]: BUILD STARTED |
CI MESSAGE: [951222]: BUILD FAILED |
- use AffineMapping - calculate output canvas size New: - Rotate operator - RotateParamProvider Changes: - add AdjustParams to WarpParamProvider - factor out WarpAttr schema - add deg/rad conversion to math_util Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
…at the augmentations really did. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
…center. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
!build |
Add comments to augmentation gallery. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
CI MESSAGE: [955335]: BUILD STARTED |
R"code(Counterclockwise rotation angle, in degrees.)code", DALI_FLOAT, true) | ||
.InputLayout(0, "HWC") | ||
.AddParent("DisplacementFilter"); | ||
.DocStr(R"code(Apply an affine transformation to the image.)code") |
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.
Something more specific about Rotate?
" input_type: ", itype, | ||
" output_type: ", otype) | ||
cv_pipeline = CVPipeline(batch_size, otype, itype, output_size); | ||
cv_pipeline.build(); |
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.
build() will be invoked in compare_pipelines
so you don't need to call it here
for batch_size in [1, 4, 19]: | ||
for output_size in [None, (160,240)]: | ||
for (itype, otype) in io_types: | ||
print("Testing cpu vs cv", |
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.
If you use yield you'll get a print of the parameters automatically
" input type: ", itype, | ||
" output type: ", otype) | ||
cpu_pipeline = RotatePipeline("cpu", batch_size, otype, itype, output_size); | ||
cpu_pipeline.build(); |
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.
same here
#include "dali/core/format.h" | ||
|
||
namespace dali { | ||
namespace rotate_impl { |
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.
namespace rotate_impl { | |
namespace rotate { | |
namespace impl { |
maybe?
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.
A shy 'no'? I don't think that level of nesting is necessary.
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.
As a matter of fact, I'll remove this namespace and have the using
directives in the function that needs them.
CI MESSAGE: [955335]: BUILD FAILED |
Fix review issues. Reorganize tests. Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
!build |
CI MESSAGE: [955504]: BUILD STARTED |
CI MESSAGE: [955504]: BUILD PASSED |
* Breaking (?) changes: - `Rotate` now calculates output size to fit the rotated image *by default* - Interpolation method now defaults to INTERP_LINEAR * New Rotate operator based on Warp operator base: - use AffineMapping - infer output size * Remove old Rotate * Remove CropMirrorNormalize from augmentation_gallery - it obscured what the augmentations really did. * Remove Rotate test from `test_pipeline.py` * Add standalone rotate python test with OpenCV reference Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz michalz@nvidia.com
Why we need this PR?
What happened in this PR?
JIRA TASK: [DALI-1095]