-
Notifications
You must be signed in to change notification settings - Fork 622
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
Equalization operator #4575
Equalization operator #4575
Conversation
ae107e5
to
4551a07
Compare
assert(layout.size() == 2 || layout.size() == 3); | ||
output.SetLayout(layout); | ||
kernels::DynamicScratchpad scratchpad({}, AccessOrder(ws.stream())); | ||
ctx_.gpu.stream = ws.stream(); |
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.
ctx should be a local variable - you populate all of its fields anyway.
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.
done
imgs = [np.array(img) for img in imgs.as_cpu()] | ||
assert len(equalized) == len(imgs) | ||
baseline = [equalize_cv_baseline(img, layout) for img in imgs] | ||
check_batch(equalized, baseline) |
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.
Do we expect bit-exactness with OpenCV?
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 discussed elsewhere, the algorithm is the same, the only float arithmetic is scaling of the comulative. It happens to work, let us see if the CI does not complain.
template <int ndim> | ||
TensorListShape<2> GetFlattenedShape(TensorListShape<ndim> shape) { | ||
if (shape.sample_dim() == 3) { // has_channels | ||
return collapse_dims<2>(shape, {{0, shape.sample_dim() - 1}}); |
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.
The layout can be HWC and CHW, doesn't it impact anything here?
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.
SequenceOperator handles the latter
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
4551a07
to
be9cb31
Compare
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
CI MESSAGE: [7059662]: BUILD STARTED |
CI MESSAGE: [7059662]: BUILD PASSED |
Signed-off-by: Kamil Tokarski <ktokarski@nvidia.com>
Signed-off-by: Kamil Tokarski ktokarski@nvidia.com
Category:
New feature (non-breaking change which adds functionality)
Description:
Adds per-channel histogram equalization operator (GPU, uint8_t).
Additional information:
Uses kernels added in the #4565
It is needed to implement the standard RandAugment/AutoAugment policies.
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-3187