Torchvision API to tensor/PIL image conversion operators #6282
Open
mdabek-nvidia wants to merge 80 commits intoNVIDIA:mainfrom
Open
Torchvision API to tensor/PIL image conversion operators #6282mdabek-nvidia wants to merge 80 commits intoNVIDIA:mainfrom
mdabek-nvidia wants to merge 80 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com> Co-authored-by: Kamil Tokarski <kamiltokarski04@gmail.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-of-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Center crop operators implementation Signed-off-by: Marek Dabek <mdabek@nvidia.com> Co-authored-by: Kamil Tokarski <kamiltokarski04@gmail.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
…VIDIA#6262) * Improve call stack depth handling for error tracebacks in dynamic mode * Rework exception_tester to automatically infer expected line and message --------- Signed-off-by: Rostan Tabet <rtabet@nvidia.com>
Add uniform_sample option to VideoReaderDecoder
Adds a `uniform_sample` argument that samples exactly `sequence_length`
frames uniformly across the full video (or ROI) using linspace with
std::round rounding. Each video produces one sample per epoch; `stride`
and `step` are ignored (with a DALI_WARN if `pad_mode` is also set).
`sequence_length` must be >= 1 when `uniform_sample=True`.
To avoid a per-sample heap allocation, VideoSampleDesc::frame_idxs_
changes from std::vector<int> to span<const int>. Owned storage moves
to all_frame_idxs_ (vector<vector<int>>) in the loader, which is
populated once in PrepareMetadataImpl and stable for the loader's
lifetime. The copy in ReadSample becomes a cheap 16-byte span copy.
all_frame_idxs_ is declared before samples_ so its lifetime encloses
the spans, preventing dangling references on destruction.
New tests:
- test_uniform_sample_basic: verifies frame indices match expected linspace
- test_uniform_sample_file_list_roi: ROI with non-zero start_frame via file_list
- test_uniform_sample_sequence_length_zero_raises: sequence_length=0 raises
- test_uniform_sample_stride_step_ignored: stride/step have no effect
Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
- cudaDeviceSynchronize returns cudaErrorStreamCaptureUnsupported when any stream on the device is being captured. DLTensorGraveyard now puts pending deletions back in the queue and retries after a short wait instead of propagating the error. Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
* Torchvision ColorJitter and Grayscale implementations Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
d5b9899 to
cdc9d3e
Compare
mzient
reviewed
Apr 13, 2026
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
00a0a76 to
a807873
Compare
rostan-t
reviewed
Apr 13, 2026
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Show resolved
Hide resolved
mzient
reviewed
Apr 13, 2026
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
mzient
reviewed
Apr 13, 2026
mzient
reviewed
Apr 13, 2026
mzient
reviewed
Apr 13, 2026
mzient
reviewed
Apr 13, 2026
dali/python/nvidia/dali/experimental/torchvision/v2/compose.py
Dismissed
Show dismissed
Hide dismissed
dali/python/nvidia/dali/experimental/torchvision/v2/compose.py
Dismissed
Show dismissed
Hide dismissed
mzient
approved these changes
Apr 14, 2026
rostan-t
approved these changes
Apr 14, 2026
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
b0f10bc to
40fb21b
Compare
Collaborator
Author
|
!build |
Collaborator
|
CI MESSAGE: [48488201]: BUILD STARTED |
dali/python/nvidia/dali/experimental/torchvision/v2/functional/totensor.py
Outdated
Show resolved
Hide resolved
40fb21b to
c719948
Compare
jantonguirao
approved these changes
Apr 14, 2026
Signed-off-by: Marek Dabek <mdabek@nvidia.com>
c719948 to
4315106
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category:
New feature
Description:
Set of operators that convert from/to torch.Tensor or PIL.Image
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A