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
Move decoders to decoders module #2725
Conversation
@@ -185,8 +185,8 @@ image format, it will decode the entire image and crop the selected ROI. | |||
|
|||
.. note:: | |||
ROI decoding is currently not compatible with hardware-based decoding. Using | |||
:meth:`nvidia.dali.fn.image_decoder` automatically disables hardware accelerated | |||
decoding. To use the hardware decoder, use the :meth:`nvidia.dali.fn.image_decoder` and | |||
:meth:`nvidia.dali.fn.decoders.image` automatically disables hardware accelerated |
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.
That's a typo (the doc before). It should be image_decoder_crop
/decoders.image_crop
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
:meth:`nvidia.dali.fn.image_decoder` automatically disables hardware accelerated | ||
decoding. To use the hardware decoder, use the :meth:`nvidia.dali.fn.image_decoder` and | ||
:meth:`nvidia.dali.fn.decoders.image` automatically disables hardware accelerated | ||
decoding. To use the hardware decoder, use the :meth:`nvidia.dali.fn.decoders.image` and |
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.
That one is correct
// Deprecated aliases | ||
|
||
DALI_SCHEMA(ImageDecoder) | ||
.DocStr("Legacy alias for :meth:`decoders.image_decoder`.") |
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.
.DocStr("Legacy alias for :meth:`decoders.image_decoder`.") | |
.DocStr("Legacy alias for :meth:`decoders.image`.") |
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 for all
// Fused | ||
|
||
DALI_SCHEMA(ImageDecoderCrop) | ||
.DocStr("Legacy alias for :meth:`decoders.image_decoder_crop`.") |
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.
.DocStr("Legacy alias for :meth:`decoders.image_decoder_crop`.") | |
.DocStr("Legacy alias for :meth:`decoders.image_crop`.") |
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
functionality to allow for backward compatibility.)code"); // Deprecated in 1.0 | ||
|
||
DALI_SCHEMA(ImageDecoderRandomCrop) | ||
.DocStr("Legacy alias for :meth:`decoders.image_decoder_random`.") |
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.
.DocStr("Legacy alias for :meth:`decoders.image_decoder_random`.") | |
.DocStr("Legacy alias for :meth:`decoders.image_random_crop`.") |
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
|
||
|
||
DALI_SCHEMA(ImageDecoderSlice) | ||
.DocStr("Legacy alias for :meth:`decoders.image_decoder_slice`.") |
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.
.DocStr("Legacy alias for :meth:`decoders.image_decoder_slice`.") | |
.DocStr("Legacy alias for :meth:`decoders.image_slice`.") |
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
batch_size_alias_test=16 | ||
|
||
@pipeline_def(batch_size=batch_size_alias_test, device_id=0, num_threads=4) | ||
def decoder_pipe(decoder_op, file_root, device, use_fast_idct, split_stages): |
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.
👍 For testing split_stages
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 only it would work.
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.
:)
Add alias test for image decoder - split decoder is broken. TODO: test for audio decoder Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
!build |
CI MESSAGE: [2119200]: BUILD STARTED |
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.
def check_audio_decoder_alias(sample_rate, downmix, quality, dtype): | ||
new_pipe = decoder_pipe(fn.decoders.audio, sample_rate, downmix, quality, dtype) | ||
legacy_pipe = decoder_pipe(fn.audio_decoder, sample_rate, downmix, quality, dtype) | ||
compare_pipelines(new_pipe, legacy_pipe, batch_size_alias_test, 10) |
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.
Peculiar indent
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
yield check_image_decoder_alias, new_op, old_op, data_path, device, use_fast_idct, split_stages | ||
|
||
def test_image_decoder_split_alias(): | ||
raise SkipTest("Sanity tests for aliases of split decoder are temporarily disabled due to accuracy issues.") |
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.
Doesn't nose
give an option in decorator to intentionally skip a test? For sure there's a @nottest
, I don't know how about skipping with explanation...
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.
This is the way. @nottest
have totally different meaning than skipping a test.
new_op, old_op = fn.decoders.image_slice, fn.image_decoder_slice | ||
for device in ["cpu", "mixed"]: | ||
for use_fast_idct in [True, False]: | ||
yield check_image_decoder_slice_alias, new_op, old_op, data_path, device, use_fast_idct |
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.
Peculiar indent
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
new_pipe = decoder_slice_pipe(new_op, file_root, device, use_fast_idct) | ||
legacy_pipe = decoder_slice_pipe(old_op, file_root, device, use_fast_idct) | ||
compare_pipelines(new_pipe, legacy_pipe, batch_size_alias_test, 10) |
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.
Peculiar indent
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
for device in ["cpu", "mixed"]: | ||
for use_fast_idct in [True, False]: | ||
for split_stages in [False]: | ||
yield check_image_decoder_alias, new_op, old_op, data_path, device, use_fast_idct, split_stages |
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.
Peculiar indent
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
new_pipe = decoder_pipe(new_op, file_root, device, use_fast_idct, split_stages) | ||
legacy_pipe = decoder_pipe(old_op, file_root, device, use_fast_idct, split_stages) | ||
compare_pipelines(new_pipe, legacy_pipe, batch_size_alias_test, 10) |
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.
Peculiar indent
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
@szalpal |
CI MESSAGE: [2119200]: BUILD PASSED |
!build |
CI MESSAGE: [2119446]: BUILD STARTED |
CI MESSAGE: [2119446]: BUILD PASSED |
Add alias test for image decoder - split decoder is broken.
Signed-off-by: Krzysztof Lecki klecki@nvidia.com
Why we need this PR?
Refactoring to introduce decoders module.
What happened in this PR?
Introduce alias operators for audio and image* decoders. Move the main ones to
decoders
moduleDecoders operators
Look out for typos?
Sanity alias tests
Yes.
JIRA TASK: [DALI-1882]