-
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
Adds video support to color based augmentations #3580
Conversation
int num_channels = in.shape[2]; | ||
int image_width = in.shape[1]; | ||
int image_hight = in.shape[0]; |
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.
int num_channels = in.shape[2]; | |
int image_width = in.shape[1]; | |
int image_hight = in.shape[0]; | |
int num_channels = in.shape[ndims-1]; | |
int image_width = in.shape[ndims-2]; | |
int image_height = in.shape[ndims-3]; |
num_channels = in.shape[3]; | ||
image_width = in.shape[2]; | ||
image_hight = in.shape[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.
num_channels = in.shape[3]; | |
image_width = in.shape[2]; | |
image_hight = in.shape[1]; |
num_channels = in.shape[3]; | ||
image_width = in.shape[2]; | ||
image_hight = in.shape[1]; | ||
// wer cannot use .z as it is field, [] is resolved in the runtime |
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.
In principle, unless we include this file in a .cu
unit, we could use .z
.
auto *row = in.data + adjusted_roi.lo.y * row_stride + img_start * row_stride * image_hight; | ||
for (int z = img_start; z < img_end; z++) { | ||
for (int y = adjusted_roi.lo.y; y < adjusted_roi.hi.y; y++) { | ||
for (int xc = adjusted_roi.lo.x * num_channels; xc < adjusted_roi.hi.x * num_channels; xc++) | ||
*ptr++ = ConvertSat<OutputType>(row[xc] * multiplier + addend); | ||
row += row_stride; | ||
} | ||
row += img_stride; |
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.
auto *row = in.data + adjusted_roi.lo.y * row_stride + img_start * row_stride * image_hight; | |
for (int z = img_start; z < img_end; z++) { | |
for (int y = adjusted_roi.lo.y; y < adjusted_roi.hi.y; y++) { | |
for (int xc = adjusted_roi.lo.x * num_channels; xc < adjusted_roi.hi.x * num_channels; xc++) | |
*ptr++ = ConvertSat<OutputType>(row[xc] * multiplier + addend); | |
row += row_stride; | |
} | |
row += img_stride; | |
auto *img = in.data + adjusted_roi.lo.y * row_stride + img_start * row_stride * image_hight; | |
for (int z = img_start; z < img_end; z++) { | |
auto *row = img; | |
for (int y = adjusted_roi.lo.y; y < adjusted_roi.hi.y; y++) { | |
for (int xc = adjusted_roi.lo.x * num_channels; xc < adjusted_roi.hi.x * num_channels; xc++) | |
*ptr++ = ConvertSat<OutputType>(row[xc] * multiplier + addend); | |
row += row_stride; | |
} | |
img += img_stride; |
batch_size=32 | ||
n_iters = 8 | ||
ri1 = RandomDataIterator(batch_size, shape=(128, 32, 3), dtype=dali_type_to_np(inp_dtype)) | ||
ri2 = RandomDataIterator(batch_size, shape=(128, 32, 3), dtype=dali_type_to_np(inp_dtype)) | ||
shape = (128, 32, 3) if not is_video else (random.randint(2-5), 128, 32, 3) |
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.
shape = (128, 32, 3) if not is_video else (random.randint(2-5), 128, 32, 3) | |
shape = (128, 32, 3) if not is_video else (random.randint(2, 5), 128, 32, 3) |
3d69f2c
to
c3f1371
Compare
using Kernel = TheKernel<OutputType, InputType>; | ||
TensorListShape<> sh = input.shape(); | ||
auto num_dims = sh.sample_dim(); | ||
int frame_num = num_dims == 3 ? 1 : sh[0][0]; |
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.
int frame_num = num_dims == 3 ? 1 : sh[0][0]; | |
int num_frames = num_dims == 3 ? 1 : sh[0][0]; |
frame_num
reads too much as "frame number" which is ambiguous
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
brightness_[sample_id], | ||
brightness_shift_[sample_id], | ||
contrast_[sample_id]); | ||
kernel_manager_.Run<Kernel>(thread_id, sample_id, ctx, tvout, tvin, |
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.
Technically, this is wrong. Now we've multipled the number of samples, so it's sum(num_frames[i] for i in range(num_samples)
. Since the kernel is stateless, we can stop pretending that there are multiple samples and just pass 0 as sample_id all the time. It will be less confusing.
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
25db40d
to
0e0d2a7
Compare
!build |
CI MESSAGE: [3617555]: BUILD STARTED |
CI MESSAGE: [3617555]: BUILD FAILED |
f7a1fe0
to
dd72aa9
Compare
!build |
CI MESSAGE: [3617736]: BUILD STARTED |
7afdfe9
to
2adeaf8
Compare
CI MESSAGE: [3617736]: BUILD FAILED |
07da4fd
to
b963aae
Compare
- extends brightness_contrast operator family - extends hue operator Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
b963aae
to
d7194d5
Compare
Signed-off-by: Joaquin Anton <janton@nvidia.com>
!build |
CI MESSAGE: [3694441]: BUILD STARTED |
CI MESSAGE: [3694441]: BUILD FAILED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
!build |
CI MESSAGE: [3694673]: BUILD STARTED |
CI MESSAGE: [3694673]: BUILD FAILED |
Signed-off-by: Joaquin Anton <janton@nvidia.com>
!build |
CI MESSAGE: [3694778]: BUILD STARTED |
CI MESSAGE: [3694778]: BUILD PASSED |
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com> Co-authored-by: Joaquin Anton <janton@nvidia.com>
Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Description
What happened in this PR
Additional information
Checklist
Tests
Documentation
DALI team only
Requirements
REQ IDs: CTSTOPS.04, BRICON.05
JIRA TASK: DALI-2509